
    eCi [                        S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSK	J
r
Jr  SSKrSSKrS r " S S5      r " S	 S
\5      r\" S/ SQ5      r " S S\5      rSS jrS rSS jr " S S\5      r " S S\5      rg)aK  Extract reference documentation from the NumPy source tree.

Copyright (C) 2008 Stefan van der Walt <stefan@mentat.za.net>, Pauli Virtanen <pav@iki.fi>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in
    the documentation and/or other materials provided with the
    distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

    N)warn)
namedtuple)CallableMappingc                    U (       a<  U S   R                  5       (       d$  U S	 U (       a  U S   R                  5       (       d  M$  U (       a<  U S   R                  5       (       d$  U S	 U (       a  U S   R                  5       (       d  M$  U $ )z<Remove leading and trailing blank lines from a list of linesr   strip)ls    T/home/james-whalen/.local/lib/python3.13/site-packages/seaborn/external/docscrape.pystrip_blank_linesr   (   s]    
AaDJJLLaD AaDJJLL
AbEKKMMbE AbEKKMMH    c                   ^    \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rSS jrS rSrg)Reader1   z!A line-based string reader.

    c                     [        U[        5      (       a  Xl        OUR                  S5      U l        U R	                  5         g)zr
        Parameters
        ----------
        data : str
           String with lines separated by '
'.

        
N)
isinstancelist_strsplitreset)selfdatas     r   __init__Reader.__init__5   s/     dD!!I

4(DI

r   c                      U R                   U   $ N)r   r   ns     r   __getitem__Reader.__getitem__D   s    yy|r   c                     SU l         g )Nr   )_lr   s    r   r   Reader.resetG   s	    r   c                 x    U R                  5       (       d%  X R                     nU =R                  S-  sl        U$ g)N    )eofr$   )r   outs     r   readReader.readJ   s-    xxzzww-CGGqLGJr   c                     X R                   S   H/  nUR                  5       (       a    g U =R                   S-  sl         M1     g Nr(   )r$   r
   )r   r   s     r   seek_next_non_empty_lineReader.seek_next_non_empty_lineR   s/    gghAwwyy1	  r   c                 F    U R                   [        U R                  5      :  $ r   r$   lenr   r%   s    r   r*   
Reader.eofY   s    ww#dii.((r   c                     U R                   nXS   H]  nU" U5      (       a  XU R                    s  $ U =R                   S-  sl         U R                  5       (       d  ML  XU R                   S-    s  $    / $ r/   )r$   r*   )r   condition_funcstartlines       r   read_to_conditionReader.read_to_condition\   se    LDd##$''**GGqLGxxzz$''!),, ! 	r   c                 J    U R                  5         S nU R                  U5      $ )Nc                 ,    U R                  5       (       + $ r   r	   r9   s    r   is_empty0Reader.read_to_next_empty_line.<locals>.is_emptyi   s    zz|##r   )r0   r:   )r   r?   s     r   read_to_next_empty_lineReader.read_to_next_empty_linef   s&    %%'	$ %%h//r   c                 *    S nU R                  U5      $ )Nc                 z    U R                  5       =(       a%    [        U R                  5       5      [        U 5      :H  $ r   )r
   r4   lstripr>   s    r   is_unindented:Reader.read_to_next_unindented_line.<locals>.is_unindentedo   s'    JJLFc$++-&8CI&EGr   )r:   )r   rF   s     r   read_to_next_unindented_line#Reader.read_to_next_unindented_linen   s    	H%%m44r   c                 r    U R                   U-   [        U R                  5      :  a  X R                   U-      $ gNr)   r3   r   s     r   peekReader.peeks   s.    77Q;TYY'!$$r   c                 ^    SR                  U R                  5      R                  5       (       + $ rK   )joinr   r
   r%   s    r   r?   Reader.is_emptyy   s!    77499%++---r   )r$   r   N)r   )__name__
__module____qualname____firstlineno____doc__r   r!   r   r,   r0   r*   r:   rA   rH   rL   r?   __static_attributes__ r   r   r   r   1   s>    )05
.r   r   c                       \ rS rSrS rSrg)
ParseError}   c                 j    U R                   S   n[        U S5      (       a  U SU R                  < 3nU$ )Nr   	docstring in )argshasattrr\   )r   messages     r   __str__ParseError.__str__~   s6    ))A,4%% 	dnn%78Gr   rW   N)rQ   rR   rS   rT   ra   rV   rW   r   r   rY   rY   }   s    r   rY   	Parameter)nametypedescc                   8   \ rS rSrSr0 SS_SS/_S/ _S/ _S/ _S	/ _S
/ _S/ _S/ _S/ _S/ _S/ _S/ _S/ _S/ _SS_SS_S0 0Er0 4S jrS rS rS r	S r
S rS rS rS rSCS jrS rS!rS"rS#\-   \-   S$-   \-   S%-   r\R)                  S&S'5      r\R)                  S(S)5      rS*r\R0                  " S+\-   S,-   5      r\R0                  " S-\-   S.-   \-   S/-   S%-   S0-   \-   5      rS1rS2 rS3 rS4 rS5 rSDS6 jr SES7 jr!SFS8 jr"S9 r#S: r$S; r%S< r&S= r'S> r(S? r)SGS@ jr*SAr+gB)HNumpyDocString   z{Parses a numpydoc string to an abstract representation

Instances define a mapping from section title to structured data.

	Signaturer)   SummaryExtended Summary
ParametersReturnsYieldsReceivesRaisesWarnsOther Parameters
AttributesMethodsSee AlsoNotesWarnings
ReferencesExamplesindexc                    Un[         R                  " U5      R                  S5      n[        U5      U l        [
        R                  " U R                  5      U l         U R                  5         g ! [         a  nX4l        e S nAff = fNr   )textwrapdedentr   r   _doccopydeepcopysections_parsed_data_parserY   r\   )r   r\   configorig_docstringes        r   r   NumpyDocString.__init__   sg    "OOI.44T:	9%	 MM$--8	KKM 	(K	s   A/ /
B9B  Bc                      U R                   U   $ r   )r   )r   keys     r   r!   NumpyDocString.__getitem__   s      %%r   c                 f    XR                   ;  a  U R                  SU 3SS9  g X R                   U'   g )NzUnknown section Ferror)r   _error_location)r   r   vals      r   __setitem__NumpyDocString.__setitem__   s7    '''  #3C5!9 G%(c"r   c                 ,    [        U R                  5      $ r   )iterr   r%   s    r   __iter__NumpyDocString.__iter__   s    D%%&&r   c                 ,    [        U R                  5      $ r   )r4   r   r%   s    r   __len__NumpyDocString.__len__   s    4$$%%r   c                    U R                   R                  5         U R                   R                  5       (       a  gU R                   R                  5       R	                  5       nUR                  S5      (       a  gU R                   R                  S5      R	                  5       nUR                  S[        U5      -  5      =(       d    UR                  S[        U5      -  5      $ )NF
.. index::Tr(   -=)r   r0   r*   rL   r
   
startswithr4   )r   l1l2s      r   _is_at_sectionNumpyDocString._is_at_section   s    		**,99==??YY^^##%==&&YY^^A$$&}}SR[)GR]]3s2w;-GGr   c                     SnSn[        U5       H  u  p$UR                  5       (       d  M    O   [        US S S2   5       H  u  p4UR                  5       (       d  M    O   X[        U5      U-
   $ )Nr   r   )	enumerater
   r4   )r   docijr9   s        r   _stripNumpyDocString._strip   sh     ~GAzz|| & !TrT+GAzz|| , SXaZ  r   c                    U R                   R                  5       nU R                  5       (       d  U R                   R                  5       (       d  U R                   R	                  S5      R                  5       (       d  US/-  nXR                   R                  5       -  nU R                  5       (       d!  U R                   R                  5       (       d  M  U$ )Nr   r)   )r   rA   r   r*   rL   r
   )r   sections     r   _read_to_next_section$NumpyDocString._read_to_next_section   s    ))335%%''		99>>"%++--B4yy88::G	 %%''		 r   c              #   p  #    U R                   R                  5       (       d  U R                  5       nUS   R                  5       nUR	                  S5      (       a	  X!SS  4v   O/[        U5      S:  a	  [        v   OX R                  USS  5      4v   U R                   R                  5       (       d  M  g g 7f)Nr   ..r(      )r   r*   r   r
   r   r4   StopIterationr   )r   r   rd   s      r   _read_sectionsNumpyDocString._read_sections   s     ))--//--/D7==?Dt$$Hn$TQ##KKQR111 ))--//s   B0B64B6c                    [        U5      n/ nUR                  5       (       d  UR                  5       R                  5       nSU;   a  UR	                  S5      S S u  pgOU(       a  SUpvOUSpvUR                  5       n[        U5      n[        U5      nUR                  [        XgU5      5        UR                  5       (       d  M  U$ )N : r   r)   )
r   r*   r,   r
   r   rH   dedent_linesr   appendrc   )	r   contentsingle_element_is_typerparamsheaderarg_namearg_typerf   s	            r   _parse_param_list NumpyDocString._parse_param_list   s    7O%%''VVX^^%F%+\\%%8!%<"())+Vh)/h113D%D$T*DMM)H=> %%''  r   z:(?P<role>\w+):z'`(?P<name>(?:~\w+\.)?[a-zA-Z0-9_\.-]+)`z(?P<name2>[a-zA-Z0-9_\.-]+)(|)rolerolenextrd   namenextz/(?P<description>\s*:(\s+(?P<desc>\S+.*))?)?\s*$z^\s*z\s*z^\s*(?P<allfuncs>z(?P<morefuncs>([,]\s+z)*)z(?P<trailing>[,\.])?r   c                 >  ^  / nU 4S jn/ nU GH  nUR                  5       (       d  M  T R                  R                  U5      nSnU(       aR  UR                  S5      nUR                  S5      (       a+  U(       a$  T R	                  SUR                  S5      U4-  SS9  U(       d7  UR                  S5      (       a!  UR                  UR                  5       5        M  U(       a  / nUR                  S	5      n	 U	R                  5       (       d  OTU" U	5      u  pnUR                  X45        XS R                  5       n	U	(       a  U	S
   S:X  a  U	SS R                  5       n	Mj  [        [        SU/5      5      nUR                  X45        GM  [        U S35      e   U$ )z
func_name : Descriptive text
    continued text
another_func_name : Descriptive text
func_name1, func_name2, :meth:`func_name`, func_name3

c                    > TR                   R                  U 5      nU(       d  [        U  S35      eUR                  S5      nU(       a  UR                  S5      OUR                  S5      nX2UR	                  5       4$ )zMatch ':role:`name`' or 'name'. is not a item namer   rd   name2)	_func_rgxmatchrY   groupend)textmr   rd   r   s       r   parse_item_name7NumpyDocString._parse_see_also.<locals>.parse_item_name6  se    $$T*A D6)<!=>>776?D&*1776?0@Dquuw&&r   Nrf   trailingzGUnexpected comma or period after function list at index %d of line "%s"Fr    allfuncsr   ,r(   r   )r
   	_line_rgxr   r   r   r   r   r   r   filterrY   )r   r   itemsr   restr9   
line_matchdescriptionfuncsr   rd   r   	match_ends   `            r   _parse_see_alsoNumpyDocString._parse_see_also+  s~    	' D::<<--d3JK(..v6##J//K(($'1~~j'A4&HI# ) % 4??3#7#7DJJL)!''
3::<<,;D,A)D	LL$.
+113DQ3#ABx~~/  F4+78e]+ D6)<!=>>; < r   c                 $   S n0 nUR                  S5      n[        U5      S:  a   U" US   R                  S5      5      S   US'   U HD  nUR                  S5      n[        U5      S:  d  M%  U" US   R                  S5      5      XES   '   MF     U$ )	z<
.. index: default
   :refguide: something, else, and more

c                 L    U  Vs/ s H  oR                  5       PM     sn$ s  snf r   r	   )lstss     r   strip_each_in2NumpyDocString._parse_index.<locals>.strip_each_inf  s    '*+s!GGIs+++s   !z::r(   r   r   default:r   )r   r4   )r   r   r   r   r+   r9   s         r   _parse_indexNumpyDocString._parse_index`  s    	, --%w<!*71:+;+;C+@A!DC	ND::c?D4y1},T!W]]3-?@G  
r   c                    U R                  5       (       a  g U R                  R                  5       nSR                  U Vs/ s H  o"R	                  5       PM     sn5      R	                  5       n[
        R                  " S5      nUR                  U5      (       a  X0S'   U R                  5       (       d  M   Ub  XS'   U R                  5       (       d  U R                  5       U S'   ggs  snf )z%Grab signature (if given) and summaryNr   z^([\w., ]+=)?\s*[\w\.]+\(.*\)$rj   rk   rl   )	r   r   rA   rO   r
   recompiler   r   )r   summaryr   summary_strcompileds        r   _parse_summaryNumpyDocString._parse_summarys  s       ii779G((w#?w!GGIw#?@FFHKzz"CDH~~k**$/[!**,,%O""$$'+'A'A'CD#$ % $@s   C(c                 ,   U R                   R                  5         U R                  5         [        U R	                  5       5      nU VVs1 s H  u  p#UiM	     nnnSU;   nSU;   nU(       a  U(       a  Sn[        U5      eU(       d  SU;   a  Sn[        U5      eU H  u  p#UR                  S5      (       dT  S UR                  S5       5       nSR                  U5      nU R                  U5      (       a  U R                  S	U S
35        US;   a  U R                  U5      X'   M  US;   a  U R                  USS9X'   M  UR                  S5      (       a  U R                  X#5      U S'   M  US:X  a  U R                  U5      U S'   M  X0U'   M     g s  snnf )Nrn   ro   z5Docstring contains both a Returns and Yields section.rp   z5Docstring contains a Receives section but not Yields.r   c              3   @   #    U  H  oR                  5       v   M     g 7fr   )
capitalize).0r   s     r   	<genexpr>(NumpyDocString._parse.<locals>.<genexpr>  s     F3Ea<<>>3Es   r   zThe section z appears twice)rm   rs   rt   ru   )rn   ro   rq   rr   rp   T)r   r   r{   rv   )r   r   r   r   r   
ValueErrorr   r   rO   getr   r   r   r   )r   r   r   r   section_nameshas_returns
has_yieldsmsgs           r   r   NumpyDocString._parse  s   		++-.9AB%5WB=0.
:ICS/!jM9ICS/!"*W%%d++F7==3EF((7+88G$$((<y)OP & & $ 6 6w ?PP $ 6 6D !7 !:##L11 $ 1 1' CWJ&#'#7#7#@Z  'W% #+ Cs   	Fc                     [        U S5      (       a7   [        R                  " U R                  5      nUSU R                   SU S3-   nU(       a  [        U5      e[        U5        g ! [         a    S n NBf = f)N_objz in the docstring of r]   .)r_   inspectgetsourcefiler  	TypeErrorr   r   )r   r   r   filenames       r   r   NumpyDocString._error_location  sr    4   "00; /		{$xjJJCS/!I    s    A' 'A65A6c                 "    U[        U5      U-  /$ r   r4   )r   rd   symbols      r   _str_headerNumpyDocString._str_header  s    c$i&''r   c                 4    / nU H  nUSU-  U-   /-  nM     U$ )Nr   rW   )r   r   indentr+   r9   s        r   _str_indentNumpyDocString._str_indent  s,    DCJ%&&C 
r   c                 P    U S   (       a  U S   R                  SS5      /S/-   $ S/$ )Nrj   *z\*r)   )replacer%   s    r   _str_signatureNumpyDocString._str_signature  s3    %--c59:bTAA4Kr   c                 ,    U S   (       a	  U S   S/-   $ / $ )Nrk   r)   rW   r%   s    r   _str_summaryNumpyDocString._str_summary  s    	?	?bT))Ir   c                 ,    U S   (       a	  U S   S/-   $ / $ )Nrl   r)   rW   r%   s    r   _str_extended_summary$NumpyDocString._str_extended_summary  s#    "#*+rd22Ir   c                    / nX   (       a  X R                  U5      -  nX    H  n/ nUR                  (       a  UR                  UR                  5        UR                  (       a  UR                  UR                  5        USR	                  U5      /-  nUR
                  (       d  M  SR	                  UR
                  5      R                  5       (       d  M  X R                  UR
                  5      -  nM     US/-  nU$ )Nr   r)   )r  rd   r   re   rO   rf   r
   r  )r   rd   r+   parampartss        r   _str_param_listNumpyDocString._str_param_list  s    :##D))C::LL,::LL,

5)**:::"''%**"5";";"="=++EJJ77C $ B4KC
r   c                 \    / nX   (       a   X R                  U5      -  nX U   -  nUS/-  nU$ rK   )r  )r   rd   r+   s      r   _str_sectionNumpyDocString._str_section  s;    :##D))C:CB4KC
r   c                    U S   (       d  / $ / nX R                  S5      -  nUS/-  nSnU S    H  u  pE[        U[        5      (       d   e/ nU H>  u  pxU(       a
  SU SU S3n	OU(       a
  SU SU S3n	OSU S3n	UR                  U	5        M@     SR	                  U5      n	X)/-  nU(       a'  X R                  S	R	                  U5      /5      -  nSnM  S
nX R                  U R                  /5      -  nM     U(       a  US/-  nUS/-  nU$ )Nrv   r)   Tr   z:``z`_, r   F)r  r   r   r   rO   r  empty_description)
r   	func_roler+   last_had_descr   rf   linksfuncr   links
             r   _str_see_alsoNumpyDocString._str_see_also  s3   JI
++t
+KEeT****E#
tfBtfA.DykD63DtfB<DT" $ 99U#D6MC''$(899 $ %'')?)?(@AA% ,( B4KCt
r   c                     U S   n/ nSnUR                  SS5      nU(       a  SnUSU 3/-  nUR                  5        H*  u  pVUS:X  a  M  SnUSU SS	R                  U5       3/-  nM,     U(       a  U$ g)
Nr{   Fr   r)   Tz.. index:: z   :z: r'  )r   r   rO   )r   idxr+   output_indexdefault_indexr   
referencess          r   
_str_indexNumpyDocString._str_index  s    7m	2.L+m_-..#&99;G)#Ld7)2dii
&;%<=>>C	 $/
 Jr   c                    / nX R                  5       -  nX R                  5       -  nX R                  5       -  nS H  nX R                  U5      -  nM     X R	                  S5      -  nX R                  U5      -  nS H  nX R	                  U5      -  nM     S H  nX R                  U5      -  nM     X R                  5       -  nSR                  U5      $ )N)rm   rn   ro   rp   rs   rq   rr   rx   )rw   ry   rz   )rt   ru   r   )r  r  r  r   r#  r.  r5  rO   )r   r)  r+   
param_listr   s        r   ra   NumpyDocString.__str__"  s    ""$$  ""))++BJ''
33CB 	  ,,!!),,4A$$Q''C 53J''
33C 4  yy~r   )r   r   N)F)Tr      )r)   ),rQ   rR   rS   rT   rU   r   r   r!   r   r   r   r   r   r   r   r   _role_funcbacktick
_funcplain	_funcnamer  _funcnamenext_descriptionr   r   r   r   r(  r   r   r   r   r   r  r  r  r  r  r   r#  r.  r5  ra   rV   rW   r   r   rh   rh      s:   RB4 	B 	b	
 	2 	" 	B 	" 	 	B 	b 	2 	B 	 	B  	b!" 	B#$ 	%H* *, &)'&H!	
2J E>M/Ju},t3j@4GI%%fj9M!))&*=MEL

7Y.78I

		 	!	! $1	1 4:	: 			
 	 	  		I 3j&D,#(J( @$r   rh   c                 p   ^ SU-  mU c  T$ U R                  S5      nSR                  U4S jU 5       5      $ )Nr   r   c              3   .   >#    U  H
  nTU-   v   M     g 7fr   rW   )r   r   
indent_strs     r   r   indent.<locals>.<genexpr>9  s     3UZ!^Us   )r   rO   )strr  linesrE  s      @r   r  r  4  s9    VJ
{IIdOE993U333r   c                 j    [         R                  " SR                  U 5      5      R                  S5      $ )z"Deindent a list of lines maximallyr   )r~   r   rO   r   )rH  s    r   r   r   <  s%    ??499U+,22488r   c                 0    U S-   U[        U 5      -  -   S-   $ r}   r
  )r   styles     r   r   r   A  s    $;s4y(4//r   c                   >   ^  \ rS rSrSS0 4S jrS rU 4S jrSrU =r$ )FunctionDociE  r,  Nc                 D   Xl         X l        Uc-  Uc  [        S5      e[        R                  " U5      =(       d    Sn[
        R                  XU5        U S   (       dB  Ub>  U R                  5       u  p  [        [        R                  " U5      5      nU U 3nX`S'   g g g ! [        [        4 aZ    [        R                  S   S:  a  [        R                  " U5      nO[        R                  " U5      n[        R                  " U6 n Nvf = f! [          a    U S3n Nf = f)NzNo function or docstring givenr)   rj   r      z())_fr=  r   r  getdocrh   r   get_funcrG  	signatureAttributeErrorsysversion_infogetfullargspec
getargspecformatargspecr  )r   r,  r   r   r   	func_namerS  argspecs           r   r   FunctionDoc.__init__F  s   
;| !ABB..&,"C62K T%5"mmoOD-@ #G$5$5d$; <I  )k)5	 !* &6 
 '
3 @''*a/")"8"8">")"4"4T": ' 5 5w ?I@  -(k,	-s1   4B  D  A'D
D 	D

D DDc                    [        U R                  SU R                  R                  5      n[        R
                  " U R                  5      (       a.  [        U R                  SU R                  R                  5      nX!4$ U R                  nX!4$ )NrQ   __call__)getattrrP  	__class__rQ   r  isclassr   )r   rZ  r,  s      r   rR  FunctionDoc.get_funca  sj    DGGZ1H1HI	??477##477J0@0@AD  77Dr   c                 ,  > SnU R                  5       u  p#SSS.nU R                  (       aN  U R                  U;  a  [        SU R                   35        USUR                  U R                  S5       SU S3-  nU[        TU ]  U R                  S	9-  nU$ )
Nr)   functionmethod)r,  methzWarning: invalid role z.. z:: z
    

)r)  )rR  r=  printr   superra   )r   r+   r,  rZ  rolesr`  s        r   ra   FunctionDoc.__str__i  s    --/#!# ::zz&.tzzl;<S4::r233ykLLCuw44
r   )rP  r=  )	rQ   rR   rS   rT   r   rR  ra   rV   __classcell__)r`  s   @r   rM  rM  E  s    "(d2 *6 r   rM  c                   R    \ rS rSrS/rSS\0 4S jr\S 5       r\S 5       r	S r
S	rg)
ClassDociz  r^  Nr)   c                    [         R                  " U5      (       d  Ub  [        SU< 35      eXl        S[        R
                  ;   a  SSKJn  O
[        5       nUR                  SS5      U l
        U(       a  UR                  S5      (       d  US-  nX0l        Uc$  Uc  [        S5      e[        R                  " U5      n[        R!                  X5        UR                  S	/ 5      nXvL a  S nUR                  S
/ 5      nUR                  SS5      (       a  XLa  S n	SU R"                  4SU R$                  44 H  u  pX
   (       a  M  / n['        U5       Hc  nX;   d  U(       a  X;  a  M   [        R                  " [)        U R                  U5      5      nUR+                  [-        USU	" U5      5      5        Me     XU
'   M     g g g ! [.         a     M  f = f)Nz"Expected a class or None, but got sphinxr   )ALLshow_inherited_class_membersTr  z&No class or documentation string givenmemberszexclude-membersshow_class_membersc                 4    U (       d  / $ U R                  5       $ r   )
splitlines)r   s    r   splitlines_x'ClassDoc.__init__.<locals>.splitlines_x  s    I<<>)r   ru   rt   r)   )r  ra  r   _clsrU  modulessphinx.ext.autodocrp  objectr   show_inherited_membersendswith_modpydocrQ  rh   r   methods
propertiessortedr_  r   rc   rT  )r   clsr   
modulenamefunc_docr   rp  _members_excluderv  fieldr   doc_listrd   doc_items                  r   r   ClassDoc.__init__~  s   s##A#IJJ	s{{".(C&,jj2D':# j11#66#J	;{ !IJJ,,s#C*::i,?H::/4::*D11h6I*
 #,T\\!:".!@!B{{!H &u ,!)d.B$!',||GDIIt4L'MH$OO )$L4J KM !. #+K!B 7J1$  . ! !s   ,AG
GGc                 B   U R                   c  / $ [        R                  " U R                   5       VVs/ s H]  u  pUR                  S5      (       a  XR                  ;   d  M,  [        U[        5      (       d  MC  U R                  U5      (       d  M[  UPM_     snn$ s  snnf N_)rx  r  
getmembersr   extra_public_methodsr   r   _is_show_memberr   rd   r,  s      r   r  ClassDoc.methods  s    99I'.'9'9$))'D 5'D-- 9 99  #42  ,,T2	 'D 5 	5 5s   +B"B9BBc                 `   U R                   c  / $ [        R                  " U R                   5       VVs/ s Hl  u  pUR                  S5      (       a  M  Ub2  [	        U[
        5      (       d  [        R                  " U5      (       d  MR  U R                  U5      (       d  Mj  UPMn     snn$ s  snnf r  )rx  r  r  r   r   propertyisdatadescriptorr  r  s      r   r  ClassDoc.properties  s    99I'.'9'9$))'D 5'D, \Zh%?%?--d3  ,,T2	 'D 5 	5 5s   B*1B*B* B*c                 \    U R                   (       a  gXR                  R                  ;  a  gg)NTF)r|  rx  __dict__)r   rd   s     r   r  ClassDoc._is_show_member  s$    &&yy)))r   )rx  r~  r|  )rQ   rR   rS   rT   r  rM  r   r  r  r  r  rV   rW   r   r   rm  rm  z  sG    &< $k2+h 5 5 5 5r   rm  r;  r:  )rU   r  r~   r   r  warningsr   collectionsr   collections.abcr   r   r   rU  r   r   	ExceptionrY   rc   rh   r  r   r   rM  rm  rW   r   r   <module>r     s   8   	   " -  
I. I.X  {$<=	iW iX49
02. 2jQ~ Qr   