+
    ^|iW                     (  a R1 ta0 t R tR.t^ RIHt ^ RIHt ^ RIHt ^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHtHtHtHtHtHtHtHtHt ^ RIt^ RIHt ^ R	I H!t! ^ R
I"H#t# ^ RI$H%t% ^ RI&H't'H(t( ^ RI)H*t* ^ RI+H,t, ^ RI-H.t. ^ RI/H0t0H1t1 ^ RI2H3t3 ^ RI4H5t5 ^ RI6H7t7 ^ RI8H9t9 Rt:]];]]];];3,          ,          3,          t<] ^ k ]];];3,          t=] ^k ] ! R R4      4       t>R t?]P                  P                  P                  tB]CP                  P                  tE]P                  ]P                  ]P                  ]H3 U u0 uF  p ]P                  V 4      kK  	  up tJ]K! ]L4      tM]K! ];P                  4      tO ! R R]4      tP]Q! ]PP                  P                  4       4      tTR tU] ! R R4      4       tV]3RRR RR!R/R" R# ll4       tWR$ tXR% R& ltIR2R' R( lltYR) tZR* t[R+ R, lt\R- t]]C! 4       t^ ! R. R]4      t_R/ R0 lt`R# u up i )3zTools for inspecting Python objects.

Uses syntax highlighting for presenting the various information elements.

Similar in spirit to the inspect module, but all calls take a name argument to
reference the name under which an object is being read.
	Inspector)	dataclass)	signature)dedentN)Token)	castAnyOptionalDictUnionList	TypedDict	TypeAliasTuple)Configurable)page)pretty)skip_doctest)
PyColorizeopenpy)safe_hasattr)compress_user)indent)list_namespacetypestr2type)undoc)	highlight)PythonLexer)HtmlFormatter__custom_documentations__c                   2   a  ] tR t^Bt o R tV 3R ltRtV tR# )OInfoc                Z    \         P                  ! RV R2\        ^R7       \        W4      # )zvGet a field from the object for backward compatibility with before 8.12

see https://github.com/h5py/h5py/issues/2253
zGOInfo dataclass with fields access since IPython 8.12 please use OInfo.z instead.OInfo used to be a dict but a dataclass provide static fields verification with mypy.This warning and backward compatibility `get()` method were added in 8.13.
stacklevel)warningswarnDeprecationWarninggetattr)selffields   &&7/usr/lib/python3/dist-packages/IPython/core/oinspect.pyget	OInfo.getK   s;     	UV[U\ ]Y Y 	
 t##    c                r   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[S[,          ;R&   S[;R&   S[;R&   # )   ismagicisaliasfound	namespaceparentobj)boolr	   strr   )format__classdict__s   "r+   __annotate__OInfo.__annotate__B   sP     M  M  K	 
 }  K  
H r.    N)__name__
__module____qualname____firstlineno__r,   __annotate_func____static_attributes____classdictcell__r:   s   @r+   r!   r!   B   s     $  r.   r!   c                 @    \        V \        4       \        R R7      4      # )T)	noclasses)r   r   r   )codes   &r+   pylightrI   ]   s    T;=-$*GHHr.   c                   ,   a  ] tR t^rt o V 3R ltRtV tR# )InfoDictc                  < V ^8  d   Qh/ S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R	&   S[ S[,          ;R
&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[;R&   S[;R&   S[;R&   S[;R&   S[;R&   # )r0   	type_name
base_classstring_formr4   lengthfile
definition	docstringsourceinit_definitionclass_docstringinit_docstringcall_defcall_docstring
subclassesr1   r2   isclassr3   name)r	   r8   r7   )r9   r:   s   "r+   r;   InfoDict.__annotate__r   s<    }   #  }	 
 SM  3-    }  SM  c]"  c]"  SM!  sm  SM!   $ M% & M' ( M) * K+ , I- r.   r=   N)r>   r?   r@   rA   rB   rC   rD   rE   s   @r+   rK   rK   r   s      r.   rK   c                     V R 8X  d$   \         P                  ! R\        ^R7       \        # \	        R\
        : RV : 24      h)info_fieldszfIPython.core.oinspect's `info_fields` is considered for deprecation and may be removed in the Future. r#   zmodule z has no attribute )r%   r&   r'   _info_fieldsAttributeErrorr>   )r\   s   &r+   __getattr__rb      s@    }t	

 
78,.@I
JJr.   c                   0   a  ] tR t^t o RtV 3R ltRtV tR# )InspectorHookDatazData passed to the mime hookc                v   < V ^8  d   Qh/ S[ ;R&   S[S[,          ;R&   S[;R&   S[;R&   S[S[,          ;R&   # )r0   r6   info	info_dictdetail_levelomit_sections)r   r	   r!   rK   intlistr8   )r9   r:   s   "r+   r;   InspectorHookData.__annotate__   sM      
H	 
 5/      9 r.   r=   N)r>   r?   r@   rA   __doc__rB   rC   rD   rE   s   @r+   rd   rd      s     &  r.   rd   r[   Fr2   r1   c                `    V ^8  d   QhR\         R\        R\        R\        R\        R\        /# )r0   r\   r3   r[   r2   r1   return)r8   r7   rK   )r9   s   "r+   r;   r;      sF        
    	 
      r.   c                    \        V4      pTP                  \         Uu/ uF  qwV9  g   K  VRbK  	  up4       WR&   WR&   W&R&   W6R&   WFR&   \        R/ VB # u upi )z1Make an object info dict with all fields present.Nr\   r3   r[   r2   r1   r=   )dictupdater`   rK   )r\   r3   r[   r2   r1   kwinfodictks   $$$$$,  r+   object_inforv      so     BxHOOlHlx6GWQWlHIVW!Y!Y!Yh Is
   AAc                d   \        V 4      pVf   R# VP                  R4      '       d   R# \        P                  P	                  V4      '       g   R# \
        P                  ! VR4      ;_uu_ 4       p\        P                  ! VP                  4      w  r4RRR4       V#   + '       g   i     X# ; i)zfGet encoding for python source file defining obj

Returns None if obj is not defined in a sourcefile.
Nrbz.soz.dllz.pyd)
	find_fileendswithospathisfile	stdlib_ioopenr   detect_encodingreadline)r6   ofilebufferencoding_liness   &    r+   get_encodingr      s    
 cNE }	/	0	0WW^^E""
 ^^E4((F%55fooFH ) )(s   1#BB/	c                >    V ^8  d   QhR\         \        R3,          /# r0   ro   Nr   r8   )r9   s   "r+   r;   r;      s      5d# r.   c                     V P                  4       p\        V\        4      '       d   \        P                  ! V4      #  \        P                   ! V 4      pV#   \
         d     L%i ; i)a)  Stable wrapper around inspect.getdoc.

This can't crash because of attribute problems.

It also attempts to call a getdoc() method on the given object.  This
allows objects which provide their docstrings via non-standard mechanisms
(like Pyro proxies) to still be inspected by ipython's ? system.
)getdoc
isinstancer8   inspectcleandoc	Exception)r6   dsdocstrs   &  r+   r   r      s^    (ZZ\ b###B'' ^^C FM  s   A A%$A%c                >    V ^8  d   QhR\         \        R3,          /# r   r   )r9   s   "r+   r;   r;      s     ; ;c$h ;r.   c           	        \        V \        4      '       d   . pR F  p\        W4      pVf   K  V'       d
   RV,          MRpVP                  RP	                  RWS34      4       \
        P                  ! V4      '       d2   \        V4      pV'       d   VP                  \        V4      4       K  K  VP                  V: V: R\        V4      : R24       K  	  V'       d   RP	                  V4      # R# \        V 4      p  \
        P                  ! V 4      pV#   \         d?     \
        P                  ! T P                  4      p T#   \        \        3 d      R# i ; i\         d     R# i ; i)a<  Wrapper around inspect.getsource.

This can be modified by other projects to provide customized source
extraction.

Parameters
----------
obj : object
    an object whose source code we will attempt to extract
oname : str
    (optional) a name under which the object is known

Returns
-------
src : unicode or None

Nz%s. z# z = 
)fgetfsetfdel)r   propertyr(   appendjoinr   
isfunction	getsourcer   r   _get_wrapped	TypeError	__class__OSError)r6   onamesourcesattrnamefnoname_prefix_srcsrcs   &&      r+   r   r      s8   & #x  0H'B~27Rrwwl'EFG%%b))$R=Dvd|4  NN)5xL 1  99W%%
 3
	##C(C 
  	''6 
 Y'  		s6   D E/% EEE/EE/*E/.E/c                    \         P                  ! V 4      ;'       gG    \         P                  ! V 4      ;'       g)    \        V \        4      ;'       g    \        V \
        4      # )zTrue if obj is a function ())r   r   ismethodr   _builtin_func_type_builtin_meth_type)r6   s   &r+   is_simple_callabler   &  s]    s# W Ww'7'7'< W Ws./W W3=cCU3VXr.   c                r    T p^ p\        V R4      '       d!   V P                  p V^,          pV^d8  g   K0  V# V # )a:  Get the original object if wrapped in one or more @decorators

Some objects automatically construct similar objects on any unrecognised
attribute access (e.g. unittest.mock.call). To protect against infinite loops,
this will arbitrarily cut off after 100 levels of obj.__wrapped__
attribute access. --TK, Jan 2016
__wrapped__)r   r   )r6   orig_objis   &  r+   r   r   +  s>     H	A
sM
*
*oo	Qs7OJr.   c                :    V ^8  d   QhR\         \        ,          /# r0   ro   )r	   r8   )r9   s   "r+   r;   r;   =  s        hsm  r.   c                    \        V 4      p Rp \        P                  ! V 4      pV#   \         d?     \        P                  ! T P                  4      p T#   \
        \        3 d      T# i ; i\
         d     T# i ; i)a6  Find the absolute path to the file where an object was defined.

This is essentially a robust wrapper around `inspect.getabsfile`.

Returns None if no file can be found.

Parameters
----------
obj : any Python object

Returns
-------
fname : str
    The absolute path to the file where the object was defined.
N)r   r   
getabsfiler   r   r   )r6   fnames   & r+   rz   rz   =  s      s
CE""3' L  	&&s}}5E L # 	 L	  Ls2   ' A= AA,'A=+A,,A=8A=<A=c                   \        V 4      p  \        P                  ! V 4      ^,          pV#   \         dF     \        P                  ! T P                  4      ^,          p T#   \
        \        3 d      R# i ; i\
         d     R# i ; i)a/  Find the line number in a file where an object was defined.

This is essentially a robust wrapper around `inspect.getsourcelines`.

Returns None if no file can be found.

Parameters
----------
obj : any Python object

Returns
-------
lineno : int
    The line number where the object definition starts.
N)r   r   getsourcelinesr   r   r   )r6   linenos   & r+   find_source_linesr   `  s      s
C	'',Q/ M  	++CMM:1=F M # 		 s2   , B	'A""A83B	7A88B	B	B	c                     a a ] tR tRt o]P
                  ! RRR7      P                  RR7      tR^ RRR	R/V3R
 lV 3R llltR t	R.V3R lR llt
V3R lR ltV3R lR ltV3R lR ltR tR.R lt]R/R l4       tR.R ltR.R ltR0V3R lR lltV3R lR ltV3R lR ltV3R  lR! ltR1V3R" lR# lltR2V3R$ lR% lltR3V3R& lR' llt]R( 4       t. R)R)3R*R)/R+ lltV3R, ltR-tVt V ;t!# )4r   i  TzKdictionary of mime to callable to add information into help mimebundle dict)confighelp)r   str_detail_levelr5   Nr   c                    < V ^8  d   QhRS[ /# )r0   
theme_namer8   )r9   r:   s   "r+   r;   Inspector.__annotate__  s     ( ( (r.   c               0  < VR9   d@   \         P                  ! RVP                  4        R2\        ^R7       VP                  4       pWn        \
        \        V `  W4R7       \        P                  ! RVR7      V n
        W n        V P                  V4       R# )	Linuxz?Theme names and color schemes are lowercase in IPython 9.0 use z insteadr#   )r5   r   r8   )outr   N)r   LightBGNeutralNoColor)r%   r&   lowerr'   _theme_namesuperr   __init__r   Parserparserr   set_theme_name)r)   r   r   r5   r   r   s   &$$$$r+   r   Inspector.__init__  s     CCMMQR\RbRbRdQeemn"
 $))+J%i'v'E ''EjI 0J'r.   c                :    V P                   P                  ! V/ VB # N)r   r9   )r)   argskwargss   &*,r+   r9   Inspector.format  s    {{!!42622r.   c                4   < V ^8  d   QhRS[ S[R3,          /# r   r   )r9   r:   s   "r+   r;   r     s     
 
eCHo 
r.   c                d    \        V4      '       g   R#  \        \        V4      V4      #     R# ; i)zReturn the call signature for any callable object.

If any exception is generated, None is returned instead and the
exception is suppressed.N)callable_render_signaturer   )r)   r6   r   s   &&&r+   _getdefInspector._getdef  s0    
 }}	$Ys^U;;	s   * /c                &   < V ^8  d   QhRS[ RS[ /# )r0   hro   r   )r9   r:   s   "r+   r;   r     s     T T T Tr.   c                    \         P                  V P                  ,          P                  \        P
                  V3.4      # )z*Return a header string with proper colors.)r   theme_tabler   r9   r   Header)r)   r   s   &&r+   __headInspector.__head  s0    %%d&6&67>>q@Q?RSSr.   c                    < V ^8  d   QhRS[ /# )r0   r\   r   )r9   r:   s   "r+   r;   r     s     & &3 &r.   c                    WP                  4       8X  g   Q hV\        P                  P                  4       9   g   Q hWn        WP
                  n        R # r   )r   r   r   keysr   r   r   )r)   r\   s   &&r+   r   Inspector.set_theme_name  sA    zz|###z--224444!%r.   c                    < V ^8  d   QhRS[ /# )r0   schemer   )r9   r:   s   "r+   r;   r     s     	, 	, 	,r.   c                    \         P                  ! R \        ^R7       WP                  4       8X  g   Q hVe,   V P                  V8w  d   Wn        WP
                  n        R# R# R# )zPset_active_scheme is deprecated and replaced by set_theme_name as of IPython 9.0r#   N)r%   r&   r'   r   r   r   r   )r)   r   s   &&r+   set_active_schemeInspector.set_active_scheme  sV    ^	

 '''$"2"2f"<%%+KK" #=r.   c                z    \        RV,          RR7       V'       d   \        RV,          4       R# \        4        R# )z-Generic message when no information is found.zNo %s found endzfor %sN)print)r)   msgr   s   &&&r+   noinfoInspector.noinfo  s&    mc!s+(U"#Gr.   c                *   \        V4      '       g   \        R4       R# Rp\        P                  ! V4      '       d   V P	                  R4      pV P                  W4      pVf   V P                  RV4       R# \        W0P                  V4      RR7       R# )zoPrint the call signature for any callable object.

If the object is a class, print the constructor information.zObject is not callable.Nr   zClass constructor information:
zdefinition headerr   r   )r   r   r   r[   _Inspector__headr   r   r9   )r)   r6   r   headeroutputs   &&&  r+   pdefInspector.pdef  ss    
 }}+,??3[[!CDF c(>KK+E2&V,#6r.   c                <   . p\        V4      pV'       d   V! V4      P                  RV4      pV'       d;   VP                  V P                  R4      4       VP                  \	        V4      4       \
        P                  ! V4      '       dg   \        VR4      '       dU   \        VP                  4      pVe;   VP                  V P                  R4      4       VP                  \	        V4      4       Mi\        VR4      '       dX   \        VP                  4      pV'       d;   VP                  V P                  R4      4       VP                  \	        V4      4       V'       g   V P                  RV4       R# \        P                  ! R	P                  V4      4       R# )
a  Print the docstring for any object.

Optional:
-formatter: a function to run the docstring through for specially
formatted docstrings.

Examples
--------
In [1]: class NoInit:
   ...:     pass

In [2]: class NoDoc:
   ...:     def __init__(self):
   ...:         pass

In [3]: %pdoc NoDoc
No documentation found for NoDoc

In [4]: %pdoc NoInit
No documentation found for NoInit

In [5]: obj = NoInit()

In [6]: %pdoc obj
No documentation found for obj

In [5]: obj2 = NoDoc()

In [6]: %pdoc obj2
No documentation found for obj2
z
plain/textzClass docstring:r   NzInit docstring:__call__zCall docstring:documentationr   )r   r,   r   r   r   r   r[   hasattrr   r   r   r   r   )r)   r6   r   	formatterlinesr   init_dscall_dss   &&&&    r+   pdocInspector.pdoc  s   D C[2""<4BLL%789LL$??3GC$<$<S\\*G"T[[):;<VG_-S$$S\\*GT[[):;<VG_-KK.IIdii&'r.   c                    \         P                  ! 4         \        WR7      pVf   V P	                  RV4       R# \
        P
                  ! V P                  V4      4       R#   \         d    Rp LNi ; i)z$Print the source code for an object.)r   NrT   )	linecache
checkcacher   r   r   r   r9   )r)   r6   r   r   s   &&& r+   psourceInspector.psource  s_     		C-C ;KK%(IIdkk#&'  	C	s   A" "A21A2c           	        \        V4      pVf   V P                  RV4       R# \        V4      pVf   \        R4       R# VP	                  R4      '       d   \        RV,          4       R# \
        P                  P                  V4      '       g   \        RV,          4       R# \        P                  ! V P                  \        P                  ! VRR7      4      V^,
          4       R# )	z0Show the whole file where an object was defined.NrQ   zCould not find file for objectz File %r is binary, not printing.z%File %r does not exist, not printing.F)skip_encoding_cookiery   )r   r   rz   r   r{   r|   r}   r~   r   r9   r   read_py_file)r)   r6   r   r   r   s   &&&  r+   pfileInspector.pfile*  s     #3'>KK&# =23^^3444u<=&&9EAB
 IIdkk&"5"5eRW"XY[ade[efr.   c                &   < V ^8  d   QhRS[ RS[/# )r0   textro   )r8   rq   )r9   r:   s   "r+   r;   r   C  s      3  3  3  3r.   c                    RVRR\         P                  ! V4       R2/pVf   V# V! V4      p\        V\        4      '       g   RVRRV R2/# \        V3/ VB # )a
  Return a mime bundle representation of the input text.

- if `formatter` is None, the returned mime bundle has
   a ``text/plain`` field, with the input text.
   a ``text/html`` field with a ``<pre>`` tag containing the input text.

- if ``formatter`` is not None, it must be a callable transforming the
  input text into a mime bundle. Default values for ``text/plain`` and
  ``text/html`` representations are the ones described above.

Note:

Formatters returning strings are supported but this behavior is deprecated.


text/plain	text/htmlz<pre>z</pre>)htmlescaper   rq   )r)   r  r   defaults	formatteds   &&&  r+   _mime_formatInspector._mime_formatC  sx    " $5T!2 36:

 O!$Ii.. %ii[PV>WXX H2	22r.   c                &   < V ^8  d   QhRS[ RS[/# )r0   bundlero   )UnformattedBundleBundle)r9   r:   s   "r+   r;   r   e  s     $ $"3 $ $r.   c                X   \        VR,          \        4      '       g   Q hVR,           F  p\        V\        4      '       d   K  Q h	  / p. p\        R VR,           4       4      pVR,           Fg  w  rgVP	                  R4      pRV9   d   RMRpVP                  V P                  VR,           4       V\        V4      ,
          R,           V V 24       Ki  	  RP                  V4      VR&   RV9   d   \        VR,          \        4      '       g   Q hVR,           F  p\        V\        4      '       d   K  Q h	  \        VR,          \        \        34      '       d#   RP                  R VR,           4       4      VR&   VP                  4        F  p	V	R9   d   K  W,          W9&   K  	  V# )	zRFormat a mimebundle being created by _make_info_unformatted into a real mimebundler  c              3   <   "   T F  w  r\        V4      x  K  	  R # 5ir   len).0r   _s   &  r+   	<genexpr>(Inspector.format_mime.<locals>.<genexpr>n  s     ;&:da3q66&:s   r   r   :r  c              3   6   "   T F  w  rR V RV 2x  K  	  R# 5i)z<h1>z</h1>
Nr=   )r"  headbodys   &  r+   r$  r%    s#      /CV<Dd4&v.CVs   )r  r  )
r   rk   tuplemaxstripr   r   r!  r   r   )
r)   r  itemnew_br   _lenr(  r)  delimru   s
   &&        r+   format_mimeInspector.format_mimee  s    &.5555<((DdE**** ) ;f\&:;; ..JD::d#D DLDcELL;;tCx()4#d)+;S*@)A%O / #ii.l& f[148888{++!$.... , &-e}==%)YY /CI+CV/ &k" A//!9	 
 r.   c          	      B   < V ^8  d   QhRS[ RS[RS[RS[S[,          /# )r0   r  titlekeyri   )r  r8   r   )r9   r:   s   "r+   r;   r     s=     N N!N N 	N CyNr.   c                    W%9   g   W59   d   R# WC,          pVeT   V P                  Wv4      pVR,          P                  W(R,          34       VR,          P                  W(R,          34       R# R# )z^Append an info value to the unformatted mimebundle being constructed by _make_info_unformattedNr  r  )r  r   )	r)   r  r4  r5  rf   ri   r   r*   formatted_fields	   &&&&&&&  r+   _append_info_fieldInspector._append_info_field  sj     !S%9	"//AO< ''0M(NO;&&{/K'LM r.   c                    < V ^8  d   QhRS[ /# r   )r  )r9   r:   s   "r+   r;   r     s     L L	Lr.   c                P  a aa R. R. /pR(R VVV 3R lllpR V 3R llpSR,          '       d   V! VRR	4       V# SR
,          '       d+   V^ 8  d   V! VRRV4       MV! VRRV4       V! VRR4       V# SR,          '       g   \        V4      '       do   V! VRRV4       V! VRRV4       V! VRRV4       V^ 8  d   SR,          '       d   V! VRRV4       MV! VRRV4       V! VRR4       V! VRR4       V! VRR4       V# V! VRRV4       V! VRRV4       V! VRR4       V! VRR	4       SR,          R 8w  d   V! VR!R4       V! VR"R#4       V! VRR4       V^ 8  d   SR,          '       d   V! VRRV4       MV! VRRV4       V! VR$R%V4       V! VRRV4       V! VR&R'V4       V# ))z;Assemble the mimebundle as unformatted lists of informationr  r  c                <    V ^8  d   QhR\         R\        R\        /# )r0   r  r4  r5  )r  r8   )r9   s   "r+   r;   6Inspector._make_info_unformatted.<locals>.__annotate__  s$     
	 
	%
	.1
	8;
	r.   c           	      6   < SP                  V VVSSVR 7       R# ))r4  r5  rf   ri   r   N)r8  )r  r4  r5  r   rf   ri   r)   s   &&&&r+   append_field6Inspector._make_info_unformatted.<locals>.append_field  s*     ##+# $ r.   c                $    V ^8  d   QhR\         /# r   )r  )r9   s   "r+   r;   r=    s     	 	F 	r.   c                 @   < R SP                  V 4      R\        V 4      /# )r  r  )r9   rI   )r  r)   s   &r+   code_formatter8Inspector._make_info_unformatted.<locals>.code_formatter  s$    dkk$/WT] r.   r2   ReprrO   r1   SourcerT   	DocstringrS   FilerQ   r[   	SignaturerR   zInit signaturerU   zInit docstringrW   TyperM   
SubclassesrZ   zCall signaturerX   zString formr4   Interactive	NamespaceLengthrP   zClass docstringrV   zCall docstringrY   r   )r   )	r)   r6   rf   r   rh   ri   r  r?  rC  s	   f&f&&f   r+   _make_info_unformatted Inspector._make_info_unformatted  s   
 "%

	 
		 	 	??7^ [ )__aVXxHV[+yI0P M )__ 23 7 7lNK!13DnUk9EaDNNVXxHV%57GS05|<4 - lNK!1:~N5> K M1V[+>840 aDNNVXxHV[+yI!24EyQ!13CYO!13CYOr.   c                   < V ^8  d   QhRS[ RS[RS[S[,          RS[RS[S[S[,          S[R,          3,          RS[/# )r0   r6   r   rf   rh   ri   ro   r=   )	r   r8   r	   r!   rj   r   r   r   r  )r9   r:   s   "r+   r;   r     s]     ?( ?(?( ?(
 uo?( ?( T#Yb	12?( 
?(r.   c                   V P                  WWER7      p\        V4      pV P                  VVVVVR7      pV P                  '       d   \	        VVVVVR7      p	V P                  P                  4        F  w  r\        P                  ! V4      P                  P                  4        Uu. uF0  pVP                  \        P                  P                  8w  g   K.  VNK2  	  pp\        V4      ^8X  d
   V! V	4      pM%\        P                  ! R\        ^R7       V! W4      pVf   K  WV
&   K  	  V P!                  V4      # u upi )a  Retrieve an info dict and format it.

Parameters
----------
obj : any
    Object to inspect and return info from
oname : str (default: ''):
    Name of the variable pointing to `obj`.
formatter : callable
info
    already computed information
detail_level : integer
    Granularity of detail level, if set to 1, give more information.
omit_sections : list[str]
    Titles or keys to omit from output (can be set, tuple, etc., anything supporting `in`)
)r   rf   rh   )rh   ri   )r6   rf   rg   rh   ri   zMIME hook format changed in IPython 8.22; hooks should now accept a single parameter (InspectorHookData); support for hooks requiring two-parameters (obj and info) will be removed in a future versionr#   )rf   rk   rO  
mime_hooksrd   itemsr   r   
parametersvaluesdefault	Parameterr!  r%   r&   r'   r1  )r)   r6   r   r   rf   rh   ri   rg   r  	hook_datar5  hook	parameterrequired_parametersress   &&&&&&&        r+   	_get_infoInspector._get_info  s=   4 IIcTIU	]+,,%' - 
 ???)#)+I "__224	 &-%6%6t%<%G%G%N%N%P'%P	 ((G,=,=,E,EE I%P $ '
 *+q0y/CMM] +#$ s/C?"%3K% 5& ''%'s   &+D;D;c                0   < V ^8  d   QhRS[ S[,          /# )r0   rf   )r	   r!   )r9   r:   s   "r+   r;   r   -  s     ' '
 uo'r.   c           	     |    Vf   Q hV P                  WW4WWR7      pV'       g   VR \        P                  ! V4       R# )a  Show detailed information about an object.

Optional arguments:

- oname: name of the variable pointing to the object.

- formatter: callable (optional)
      A special formatter for docstrings.

      The formatter is a callable that takes a string as an input
      and returns either a formatted string or a mime type bundle
      in the form of a dictionary.

      Although the support of custom formatter returning a string
      instead of a mime type bundle is deprecated.

- info: a structure with some information fields which may have been
  precomputed already.

- detail_level: if set to 1, more information is given.

- omit_sections: set of section keys and titles to omit
N)ri   r  )r^  r   )	r)   r6   r   r   rf   rh   enable_html_pagerri   info_bs	   &&&&&&&& r+   pinfoInspector.pinfo-  sD    B 	 ( 
 !{#		&r.   c                    < V ^8  d   QhRS[ /# r   )rK   )r9   r:   s   "r+   r;   r   V  s     k k kr.   c                   Vf   RpRpRpM$VP                   pVP                  pVP                  pVP                  R4      R,,          pRp	Rp
V'       d[   VP                  eM   \        VP                  \        4      '       d-   \        VP                  \        4      pVP                  VR4      p	\        \        / \         Uu/ uF  qRbK  	  upCRVRRRVR	VR
R/C4      pV	'       d   T	pM~V'       dc   \        V4      '       g    RV^,          ,          pMSR\        V4      ,           pVP                  '       d   VRVP                  ,           ,          pM\        V4      pVf   RpMTpW,           p^p\!        V^,
          ^,          4      pV'       d   RVR&   M&V'       d   RVR&   M\#        V4      P$                  VR&    VP&                  p\        V4      VR&   Y@P(                  8  d    \        T4      pT'       gt   \+        T4      T8  dd   TRT R,           TT) R ,           pRR\+        RP-                  4       4      ,          ,           P/                  R TP                  R4       4       4      pTTR&   T'       d   Y}R&    \        \+        T4      4      TR&   Rp\3        T4      pTf   RpMATP5                  R-4      '       d   RpMTP5                  R4      '       d   Rp\7        T4      TR&   T'       dY   \8        P:                  ! 4         \=        T\>        4      '       g	   T'       g%   \A        Y4      pTe   TPC                  4       pTTR&   T'       d,   T PE                  TP                  R4      T4      '       g   YR&   \F        PH                  ! T4      '       d   RTR &    T PK                  Y4      p TPN                  pTf    T PK                  TT4      p\        T4      pT\P        8X  d   RpT'       d   TTR!&   T'       d   TTR"&   \"        PS                  T4       Uu. uF  pTP$                  NK  	  pp\+        T4      ^
8  d   R#P/                  T4      pM R#P/                  TR$,          R%.,           4      pTTR
&   T# T PK                  Y4      pT'       d   TTR&&   T'       d:    \        TR'4      p\        T4      pT\T        9   d   RpT'       d   TT8w  d   TTR(&    \        TPN                  4      pT\P        8X  d   RpT'       d   TTR"&   \W        TR)4      '       d   \Y        T4      '       go   T PK                  TPZ                  T4      p T '       d   T TP                  R&4      8w  d   T TR*&   \        TPZ                  4      p!T!\\        8X  d   Rp!T!'       d   T!TR+&   T# u upi    R\        T4      ,           p ELX; i    EL; i    ELZ; i  \0         d     ELGi ; i  \0         d     ELi ; i  \L         d    Rp ELRi ; i  \L         d     EL@i ; i  \L         d    Rp EL<i ; iu upi    Rp EL}; i  \L         d    Rp ELLi ; i).a  Compute a dict with detailed information about an object.

Parameters
----------
obj : any
    An object to find information about
oname : str (default: '')
    Name of the variable pointing to `obj`.
info : (default: None)
    A struct (dict like with attr access) with some information fields
    which may have been precomputed already.
detail_level : int (default:0)
    If set to 1, more information is given.

Returns
-------
An object info dict with known fields from `info_fields` (see `InfoDict`).
NFr   .r\   r3   Tr2   r1   rZ   z!Alias to the system command:
  %szAlias: z	Alias to z
Docstring:
z<no docstring>zMagic functionrM   zSystem aliasrN   z <...> r   r   rO   c              3   @   "   T F  qP                  4       x  K  	  R # 5ir   )r,  )r"  qs   & r+   r$  !Inspector.info.<locals>.<genexpr>  s      O+;a		+;s   r4   rP   z<string>z9Dynamically generated function. No source code available.rQ   rT   rS   r[   rU   rW   , :N
   Nz...rR   r   rV   r   rX   rY   ry   )/r1   r2   r4   splitr5   r   	HOOK_NAMEr(   r,   r   rK   r`   r   r8   rm   r   rj   typer>   r   r   r!  
expandtabsr   r   rz   r{   r   r  r  r   r   r   rstrip_source_contains_docstringr   r[   r   ra   r   _object_init_docstring__subclasses___builtin_type_docstringsr   r   r   _func_call_docstring)"r)   r6   r   rf   rh   r1   r2   ospaceatt_nameparents_docspreludeparents_docs_dictr*   r   r   
ds_or_None
string_maxshalfbclassostrbinary_filer   r   init_defobj_initr  subnames	all_namesdeflnclsclass_dsrX   r  s"   &&&&&                             r+   rf   Inspector.infoV  s   ( <GGFllGllG^^F ;;s#B'DKK+Y0O0O 'Y ?,004@L	,89L5$;L9	 ETww $	
 BC==.=AFB !3s8+;;;*S[[88BJ!%\ 
Z!^q()/C-C#Cy11C	]]F #FC
 0003x#D	J(><)3dE67mCD !3]-E-E-G)H#HHNN O+/::d+;O D &*M" %	CMCM
 #= K~~566"
++S'.CK    "c8,,K#C/C!jjl$'CM d55cggh6GLL! ??3!C	N <<3
#<< ##'<<%#@ !*44"G)1%&(/$%-1-@-@-EF-EcS\\-EEF5zB IIe,	 IIeCj%&89	 )Cd 
] LL,E$)L! +!#k2C  &c{H77#Hh-5C)* .44"G (/$% C,,5G5L5L<<e<SWW\-B!B '/C
O .22"G,3C()
I :"."SX-B:	  		:   "    *  " * G($#H " s   V%V* W ,BW W W& ,$W& %W8 7X X #X2*X7 #"Y *WW	WW#"W#&W54W58X	X	XXX/.X/7X>YYc                     \         P                  ! \        V 4      4      P                  w  p\         P                  ! V4      V8H  #   \
         d     R# i ; i)z
Check whether the source *src* contains the docstring *doc*.

This is is helper function to skip displaying the docstring if the
source already contains it, avoiding repetition of information.
F)astparser   r)  get_docstringr   )r   docdef_nodes   && r+   rt  $Inspector._source_contains_docstringC  sK    	))F3K055KX$$X.#55 	 		s   AA AAF
list_typesc          	        RpRpV'       d5   \         P                   ! RP                  \        \        4      4      4       R# VP	                  4       p	\        V	4      p
V
^8X  d   V	^ ,          pMV
^8X  d   V	w  rM\        RV,          4      hV F*  pW9  g   K  \        RV: RVP                  4       : 24      h	  \        4       \        4       rV FV  pW.,          p\        V4      V9   d   K  VP                  \        V4      4       \        WVWER7      pVP                  V4       KX  	  \         P                   ! RP                  \        V4      4      4       R# )	aB  Search namespaces with wildcards for objects.

Arguments:

- pattern: string containing shell-like wildcards to use in namespace
  searches and optionally a type specification to narrow the search to
  objects of that type.

- ns_table: dict of name->namespaces for search.

Optional arguments:

  - ns_search: list of namespace names to include in search.

  - ignore_case(False): make the search case-insensitive.

  - show_all(False): show all names, including those starting with
    underscores.

  - list_types(False): list all available object types for object matching.
allr   r   Nz)invalid argument string for psearch: <%s>zinvalid namespace <z>. Valid names: )ignore_caseshow_all)r   r   sortedr   ro  r!  
ValueErrorr   setidaddr   rr   )r)   patternns_table	ns_searchr  r  r  type_patternfiltercmdslen_cmdsr\   search_resultnamespaces_seenns_namenstmp_ress   &&&&&&$          r+   psearchInspector.psearchT  s(   4  IIdii| 456}}Yq=!WF]"&F<H$% & & D# "&x}}"8 9 9  *- G"B"v(2'$Rv0;PG  ) ! 			$))F=123r.   c                &   < V ^8  d   Qh/ S[ ;R&   # )r0   r   r   )r9   r:   s   "r+   r;   r     s       r.   )r   r   r   r   )r   Nr   )r   NN    r=   )r   NNr  Tr=   )r   Nr  )"r>   r?   r@   rA   	traitletsr
   tagrS  r   r9   r   r   r   r   r   r   r   r  r  r  r  r1  r8  rO  r^  rd  rf   staticmethodrt  r  rB   rC   rD   __classcell__)r   r:   s   @@r+   r   r     s2    Z 
cc ( 	(
 ( ( (*3
 
T T& &	, 	,7, 6( 6(p(g2 3  3D$ $LN N$L L^?( ?(B' 'Rk kZ    13!5@4@E@4c  r.   c                $    V ^8  d   QhR\         /# r   r   )r9   s   "r+   r;   r;     s     ( (# (r.   c                   . pRpRpV P                   P                  4        F  pVP                  \        P                  P
                  8X  d   RpMV'       d   VP                  R4       RpVP                  \        P                  P                  8X  d   RpMDVP                  \        P                  P                  8X  d   V'       d   VP                  R4       RpVP                  \        V4      4       K  	  V'       d   VP                  R4       \        V4      \        R V 4       4      ,           ^K8  d*   RP                  VRP                  R V 4       4      4      pM!R	P                  VR
P                  V4      4      pV P                  \        P                  Jd9   \        P                   ! V P                  4      pVRP                  V4      ,          pV# )z
This was mostly taken from inspect.Signature.__str__.
Look there for the comments.
The only change is to add linebreaks when this gets too long.
FT/*c              3   F   "   T F  p\        V4      ^,           x  K  	  R# 5i)r0   Nr   r"  rs   & r+   r$  $_render_signature.<locals>.<genexpr>  s     6v!3q6A::vs   !z{}(
{})r   c              3   D   "   T F  pR P                  V4      x  K  	  R# 5i)z    {},
N)r9   r  s   & r+   r$  r    s!      73+1aKq!!6s    z{}({})rl  z -> {})rU  rV  kindr   rX  POSITIONAL_ONLYr   VAR_POSITIONALKEYWORD_ONLYr8   r!  sumr9   r   return_annotation_emptyformatannotation)obj_signatureobj_nameresultpos_onlykw_onlyparamrenderedannos   &&      r+   r   r     si    FHG))002::**:::HMM#H::**999GZZ7,,999gMM#Gc%j! 3 c 8}s6v666;$$Xrww 73+173 03 
 ??8TYYv->?&&gnn<''(G(GHHOOD))Or.   c                h    V ^8  d   Qh/ ^ \         9   d
   \        ;R&   ^\         9   d
   \        ;R&   # )r0   r  r  )__conditional_annotations__r   )r9   s   "r+   r;   r;      s5      z @ ?9 ?{| # "	 "}r.   r  )br  rm   __all__dataclassesr   r   r   textwrapr   r  r  ior   r  r|   typesr%   pygments.tokenr   typingr   r   r	   r
   r   r   r   r   r   r  traitlets.configr   IPython.corer   IPython.lib.prettyr   IPython.testing.skipdoctestr   IPython.utilsr   r   IPython.utils.dir2r   IPython.utils.pathr   IPython.utils.textr   IPython.utils.wildcardr   r   IPython.utils.decoratorsr   pygmentsr   pygments.lexersr   pygments.formattersr   rp  r8   r  r  r!   rI   FunctionTyper   rx  objectr   ru  
ModuleType
MethodTyper   r   rw  rq  r  r   upperr   rK   rk   __annotations__r   r`   rb   rd   rv   r   r   r   r   rz   r   	_sentinelr   r   r;   )tr  s   0@r+   <module>r     s   - "   
     	    
 
 
  )  % 4 , + , % ? *  ' -'	  $CeCHo)>$>?  ?cN " $ $ $4I ))22:: 00  % 0 0%2B2B % 2 2H > >!GNN1  > 
 #Y #))_ y 2 H,,1134	K      	 
      *0*;|X
$ F@ H	Q4 Q4h(i!s   H