
    &g%                     L   S SK Jr  S SKrS SKJrJrJrJrJrJr  S SK	J
r
JrJrJrJrJrJr  SSKJrJr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSK J!r!J"r"  S\#S\#4S jr$ " S S\5      r%S\\&\\
   4   S\\'S4   4S jr(S\&S\\#   4S jr)S\&S\\#   S\*4S jr+g)    )absolute_importN)cleandocgetdocgetfileisclassismodule	signature)Any
CollectionIterableOptionalTupleTypeUnion   )GroupRenderableType)escape_control_codes)ReprHighlighter)JupyterMixin)Panel)Pretty)Table)TextTextTypedocreturnc                 0    U R                  S5      u  n  nU$ )z)Get the first paragraph from a docstring.z

)	partition)r   	paragraph_s      R/home/matz/Project1/venv/lib/python3.13/site-packages/pip/_vendor/rich/_inspect.py_first_paragraphr#      s    mmF+OIq!    c                       \ rS rSrSrSSSSSSSSSS.	S\S\\   S	\S
\S\S\S\S\S\S\SS4S jjr	S\S\
4S jrS\4S jrS\S\S\\
   4S jrS\\   4S jrS\S\\   4S jrSrg)Inspect   aY  A renderable to inspect any Python Object.

Args:
    obj (Any): An object to inspect.
    title (str, optional): Title to display over inspect result, or None use type. Defaults to None.
    help (bool, optional): Show full help text rather than just first paragraph. Defaults to False.
    methods (bool, optional): Enable inspection of callables. Defaults to False.
    docs (bool, optional): Also render doc strings. Defaults to True.
    private (bool, optional): Show private attributes (beginning with underscore). Defaults to False.
    dunder (bool, optional): Show attributes starting with double underscore. Defaults to False.
    sort (bool, optional): Sort attributes alphabetically. Defaults to True.
    all (bool, optional): Show all attributes. Defaults to False.
    value (bool, optional): Pretty print value of object. Defaults to True.
NFT)	titlehelpmethodsdocsprivatedundersortallvalueobjr(   r)   r*   r+   r,   r-   r.   r/   r0   r   c       	             [        5       U l        Xl        U=(       d    U R                  U5      U l        U	(       a  S=n=pgX0l        X@l        U=(       d    UU l        U=(       d    UU l        Xpl	        Xl
        Xl        g )NT)r   highlighterr1   _make_titler(   r)   r*   r+   r,   r-   r.   r0   )selfr1   r(   r)   r*   r+   r,   r-   r.   r/   r0   s              r"   __init__Inspect.__init__'   sk     +,3d..s3
)--G-g	LD	(&	
r$   c                     [        U5      (       d   [        U5      (       d  [        U5      (       a  [        U5      O[        [	        U5      5      nU R                  U5      nU$ )zMake a default title.)r   callabler   strtyper3   )r5   r1   	title_str
title_texts       r"   r4   Inspect._make_titleB   sN     # HT#Y 	
 %%i0
r$   c                 l    [         R                  " [        U R                  5       6 U R                  SSS9$ )Nzscope.borderr   r   )r(   border_stylepadding)r   fitr   _renderr(   )r5   s    r"   __rich__Inspect.__rich__L   s.    yy4<<>"**'	
 	
r$   namec                 0    [        [        U5      5      S-   nSn [	        U5      n[        USS9nU(       a  UR                  SU 35        U R                  U5      nU=(       d    [        USU5      n[        R                  " U5      (       a  SnO [        R                  " U5      (       a  S	nOS
n[        R                  " U S3SUR                  SS5       34US4U5      n	U	$ ! [         a    Sn N[         a     gf = f! [
        [        4 a     Nf = f)zGet a signature for a callable.:z(...)Nzinspect.callablestylezlink file://__qualname__classz	async defdef zinspect.r!   )r:   r	   
ValueError	TypeErrorr   OSErrorr   stylizer3   getattrinspectr   iscoroutinefunctionassemblereplace)
r5   rG   r1   
_signaturesource_filenamecallable_namesignature_textqualnameprefixqual_signatures
             r"   _get_signatureInspect._get_signatureT   s(   	Ys^,s2J *.	%clO
 T);<!!L0A"BC))*5=73= ??3F((-- FFxq\XfnnS#&>%?@A)*
 C  	! J 		 # 		s(   C% D %C?3	C?>C?DDc           	   #     ^#    S[         [        [        4   S[         [        [        4   4S jnS[        S[         [        [        4   4U4S jjnU R                  m[        T5      n[        U5      nU R                  (       d)  U Vs/ s H  oUR                  S5      (       a  M  UPM     nnU R                  (       d)  U Vs/ s H  oUR                  S5      (       a  M  UPM     nnU[        U5      -
  nU Vs/ s H  oUU" U5      4PM     nnU R                  (       a  UR                  US9  [        R                  " S	S
S9nUR                  SS9  UR                  n	U R                  n
[!        T5      (       a  U R#                  ST5      nUb  Uv   Sv   U R$                  (       a.  U R'                  T5      nUb  [)        USS9nU
" U5      nUv   Sv   U R*                  (       aJ  [-        T5      (       d:  [!        T5      (       d*  [/        T5      (       d  [1        [3        TSSSS9SS9v   Sv   U GHE  u  nu  p[(        R4                  " UUR                  S5      (       a  SOS4S5      nUb;  UR7                  5       nUR9                  S5        U	" UU
" [;        U5      5      5        Mx  [!        U5      (       a  U R<                  (       d  M  U R#                  X_5      nUc  U	" U[3        XS95        M  U R$                  (       aW  U R'                  U5      nUbC  UR?                  SU;   a  SOS5        U
" U5      nUR9                  S5        UR?                  U5        U	" UU5        GM5  U	" U[3        XS95        GMH     UR@                  (       a  Uv   gU(       a  [(        RB                  " S U S!35      v   ggs  snf s  snf s  snf 7f)"zRender object.itemr   c                 d    U u  nu  p#[        U5      UR                  S5      R                  5       4$ )Nr!   )r9   striplower)rc   key_errorr0   s       r"   
sort_items#Inspect._render.<locals>.sort_items~   s.    #' C&UOSYYs^%9%9%;<<r$   	attr_namec                 X   >  S[        TU 5      4$ ! [         a  nUS4s SnA$ SnAff = f)zGet attribute or any exception.N)rT   	Exception)rk   errorr1   s     r"   safe_getattr%Inspect._render.<locals>.safe_getattr   s4    %gc9566 %t}$%s    
)$))__r!   )rg   r@   F)rB   expandright)justify Nzinspect.helprJ   T
   <   )indent_guides
max_length
max_stringzinspect.value.border)rA   zinspect.attr.dunderzinspect.attr)z =zinspect.equalszinspect.error)r3   
rO   zinspect.docz[b cyan]za[/][i] attribute(s) not shown.[/i] Run [b][magenta]inspect[/]([not b]inspect[/])[/b] for options.)"r   r:   r
   boolr1   dirlenr-   
startswithr,   r.   r   grid
add_columnadd_rowr3   r9   r`   r+   _get_formatted_docr   r0   r   r   r   r   rW   copyrS   reprr*   append	row_countfrom_markup)r5   ri   ro   keystotal_itemsrg   not_shown_countitemsitems_tabler   r3   r	   _docdoc_textrn   r0   key_textwarning_signature_textr+   r   r1   s                        @r"   rD   Inspect._render{   s8    	=U38_ 	=tSy1A 	=	%C 	%E#s(O 	% hh3x$i{{#'D4C~~d/CC4DD||#'C4C~~c/BC4DC%D	159:Tc|C()T:99JJ:J&jj>w/%%&&C==++B4I$99**3/DN;&x0::ws||x}}s$2"M3  H#(C%}}-0^^D-A-A)~ )H  "--/0T%[!9:||"&"5"5c"A"*HfU&LMyy#66u=++2244<4SQ"-d"3CKK6+2237Ho6&"HIA $)B   ""?+ ,Q R  K EC:s7   BON7$N7*ON<N<$O8OJ;Oobject_c                     [        U5      nUc  g[        U5      R                  5       nU R                  (       d  [	        U5      n[        U5      $ )at  
Extract the docstring of an object, process it and returns it.
The processing consists in cleaning up the doctring's indentation,
taking only its 1st paragraph if `self.help` is not True,
and escape its control codes.

Args:
    object_ (Any): the object to get the docstring from.

Returns:
    Optional[str]: the processed docstring, or None if no docstring was found.
N)r   r   re   r)   r#   r   )r5   r   r+   s      r"   r   Inspect._get_formatted_doc   sC     g<~##%yy#D)D#D))r$   )
r+   r-   r)   r3   r*   r1   r,   r.   r(   r0   )__name__
__module__rL   __firstlineno____doc__r
   r   r   r|   r6   r   r4   r   rE   r:   r`   r   r   rD   r   __static_attributes__ r$   r"   r&   r&      s   & %) !	
         
6s t 
% 
%3 %S %Xd^ %N[.1 [z*# *(3- *r$   r&   r1   .c                 T    [        U S5      (       d  [        U 5      n [        U SS5      $ )zNReturns the MRO of an object's class, or of the object itself if it's a class.__mro__r   )hasattrr;   rT   )r1   s    r"   get_object_types_mror      s)    3	"" 3i3	2&&r$   c           
      z    [        U 5       Vs/ s H   n[        USS5       S[        USS5       3PM"     sn$ s  snf )z
Returns the MRO of an object's class as full qualified names, or of the object itself if it's a class.

Examples:
    `object_types_mro_as_strings(JSONDecoder)` will return `['json.decoder.JSONDecoder', 'builtins.object']`
r   ru   .rL   )r   rT   )r1   type_s     r"   get_object_types_mro_as_stringsr      sM     *#..E 5,+
,Age^R.P-QR.  s   '8fully_qualified_types_namesc                 6    [        U 5       H
  nX!;   d  M
    g   g)z
Returns `True` if the given object's class (or the object itself, if it's a class) has one of the
fully qualified names in its MRO.
TF)r   )r1   r   	type_names      r"   is_object_one_of_typesr     s!     5S9	3 : r$   ),
__future__r   rU   r   r   r   r   r   r	   typingr
   r   r   r   r   r   r   consoler   r   controlr   r3   r   jupyterr   panelr   prettyr   tabler   textr   r   r:   r#   r&   objectr;   r   r   r|   r   r   r$   r"   <module>r      s    &  K K J J J * ) ( !     # # T*l T*n'eFDI$56 '5s;K '
 
JsO 

	
.8o
	
r$   