
    -Phv                    `   d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZ ddlmZmZ ddlmZ ddlmZ ddlZddlmZmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddl m!Z!m"Z"m#Z#m$Z$ ddlm%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5 er*ddl6Z6ddl7m8Z8m9Z9 ddl:m;Z; ddlm<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZB  e+jC        eD          ZE G d d          ZF G d d          ZG G d  d!e          ZHd~d&ZIddd+ZJ G d, d-          ZKdd0ZL G d1 d2          ZMdd8ZN	 	 dddHZOddJZPddKZQddLZRddOZS eT            dPdQddXZUddZZVdd[dd_ZW	 	 	 	 	 	 	 dddmZXddqZY	 dddsZZ	 	 dddvZ[ddxZ\ddd{Z]eDd|k    r e]e
j^        d}d                    dS dS )ax  Generates reST source files for autosummary.

Usable as a library or script to generate automatic RST source files for
items referred to in autosummary:: directives.

Each generated RST file contains a single auto*:: directive which
extracts the docstring of the referred item.

Example Makefile rule::

   generate:
           sphinx-autogen -o source/generated source/*.rst
    )annotationsN)Path)TYPE_CHECKING
NamedTuple)TemplateNotFound)SandboxedEnvironment)__display_version__package_dir)Builder)Config)PycodeError)import_module)ImportExceptionGroup_get_documenterimport_by_nameimport_ivar_by_name)__)ModuleAnalyzer)SphinxComponentRegistry)loggingrst)_StrPath)getallsafe_getattr)	ensuredir)SphinxTemplateLoader)SequenceSet)NullTranslations)Any)Sphinx)EventManager)
Documenterc                      e Zd ZddZdS )_DummyEventsargsr    returnNonec                    d S N selfr&   s     _/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sphinx/ext/autosummary/generate.pyemit_firstresultz_DummyEvents.emit_firstresultB           Nr&   r    r'   r(   )__name__
__module____qualname__r/   r+   r1   r.   r%   r%   A   s(             r1   r%   c                  "    e Zd ZdZddZdd	Zd
S )DummyApplicationz3Dummy Application class for sphinx-autogen command.
translatorr   r'   r(   c                   t                      | _        t                      | _        t	                      | _        g | _        t          d          | _        || _	        d| _
        d| _        d| _        | j                            di dd           | j                            di dd           | j                            dd	dt                     d S )
N/r   Fautosummary_contextenvr+   autosummary_filename_mapautosummary_ignore_module_allT)r   configr%   eventsr   registry
messagelogr   srcdirr8   	verbosity
_warncount_exception_on_warningaddbool)r-   r8   s     r.   __init__zDummyApplication.__init__I   s    hh"nn/11%'smm$%*"-r5"===2BrBBB7udKKKKKr1   r&   r    c                    d S r*   r+   r,   s     r.   r/   z!DummyApplication.emit_firstresultX   r0   r1   N)r8   r   r'   r(   r2   )r3   r4   r5   __doc__rI   r/   r+   r1   r.   r7   r7   F   sF        ==L L L L     r1   r7   c                  8    e Zd ZU ded<   ded<   ded<   ded<   dS )	AutosummaryEntrystrname
str | NonepathtemplaterH   	recursiveN)r3   r4   r5   __annotations__r+   r1   r.   rM   rM   \   s7         IIIMMMOOOOOr1   rM   appr!   r'   r(   c           	         ddl m}m}m}m}m}m}m}m}m	}	 |||||||||	g	}
|
D ]"}| j
                            |j        |           #d S )Nr   )	AttributeDocumenterClassDocumenterDataDocumenterDecoratorDocumenterExceptionDocumenterFunctionDocumenterMethodDocumenterModuleDocumenterPropertyDocumenter)sphinx.ext.autodocrW   rX   rY   rZ   r[   r\   r]   r^   r_   rA   add_documenterobjtype)rU   rW   rX   rY   rZ   r[   r\   r]   r^   r_   documenters
documenters               r.   setup_documentersre   c   s    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 	
+K " D D
##J$6
CCCCD Dr1   =titlerN   linec                \    d| v rd}t          |          | dz   |t          |           z  z   S )N
zCan only underline single lines)
ValueErrorlen)rg   rh   msgs      r.   
_underlinern      s6    u}}/oo4<$U+++r1   c                  "    e Zd ZdZddZddZdS )AutosummaryRendererzA helper class for rendering.rU   r!   r'   r(   c                   t          |t                    rd}t          |          t          j        ddd          g}t          |j        |j        j        |          }t          |          | _
        t          j        | j
        j        d<   t          j        | j
        j        d<   t          | j
        j        d<   |j        r;| j
                            d	           | j
                            |j                   d S d S )
Nz%Expected a Sphinx application object!extautosummary	templates)loaderescapee	underlinezjinja2.ext.i18n)
isinstancer   	TypeErrorr
   joinpathr   rC   r?   templates_pathr   r<   r   rv   filtersrn   r8   add_extensioninstall_gettext_translations)r-   rU   rm   system_templates_pathru   s        r.   rI   zAutosummaryRenderer.__init__   s    c7## 	!9CC..   {CC!
 &J
13H
 
 (v666%(Z" #
(2%> 	BH""#4555H11#.AAAAA	B 	Br1   template_namerN   contextdict[str, Any]c                   	 | j                             |          }nY# t          $ rL 	 | j                             d|z            }n*# t          $ r | j                             d          }Y nw xY wY nw xY w|                    |          S )zRender a template file.zautosummary/%s.rstzautosummary/base.rst)r<   get_templater   render)r-   r   r   rR   s       r.   r   zAutosummaryRenderer.render   s    	Ix,,];;HH 	I 	I 	II8001E1UVV# I I I8001GHHI		I w'''s2    
A3AA3$A-*A3,A--A32A3NrU   r!   r'   r(   )r   rN   r   r   r'   rN   )r3   r4   r5   rK   rI   r   r+   r1   r.   rp   rp      sF        ''B B B B,( ( ( ( ( (r1   rp   rO   tuple[str | None, str]c                   |                      d          }t          |d          D ]\  }}	 d                    |d|                   }t          j        |           8# t
          $ rm |d|dz
           rDd                    |d|dz
                     d                    ||dz
  d                   fcY c S dd                    |          fcY c S t          $ r Y w xY w| dfS )a  Split full qualified name to a pair of modname and qualname.

    A qualname is an abbreviation for "Qualified name" introduced at PEP-3155
    (https://peps.python.org/pep-3155/).  It is a dotted path name
    from the module top-level.

    A "full" qualified name means a string containing both module name and
    qualified name.

    .. note:: This function actually imports the module to check its existence.
              Therefore you need to mock 3rd party modules if needed before
              calling this function.
    .   N )split	enumeratejoin	importlibr   ImportError
IndexError)rO   partsi_partmodnames        r.   _split_full_qualified_namer      s    JJsOOEeQ'' 
 
5		hhuRaRy))G#G,,,, 	- 	- 	-Wq1uW~ -xxgAg//%A.1I1IIIIIIISXXe__,,,,,, 	 	 	D	 8Os   1AAC 9C 	C C c                  .    e Zd ZddZddZddZddZdS )ModuleScannerobjr    r?   r   r@   r"   rA   r   r'   r(   c               >    || _         || _        || _        || _        d S r*   )r?   r@   rA   object)r-   r   r?   r@   rA   s        r.   rI   zModuleScanner.__init__   s$      r1   rO   rN   valuec                D    t          || j        | j                  j        S )NrA   )r   r   rA   rb   )r-   rO   r   s      r.   get_object_typezModuleScanner.get_object_type   s    udkDMJJJRRr1   rb   rH   c                    	 | j                             d|||di           S # t          $ r6}t                              t          d          ||d           Y d }~dS d }~ww xY wNzautodoc-skip-memberFz\autosummary: failed to determine %r to be documented, the following exception was raised:
%srs   type)r@   r/   	Exceptionloggerwarningr   )r-   rO   r   rb   excs        r.   
is_skippedzModuleScanner.is_skipped   s    	;//%weUB    
	 
	 
	NN>  "     55555
	s   ! 
A!+AA!imported_members	list[str]c                   g }	 t          j        | j        j                  }|                                }n# t
          $ r i }Y nw xY wt          | j        | j                  D ]}	 t          | j        |          }n# t          $ r d }Y nw xY w| 
                    ||          }|                     |||          rY	 d|f|v rd}n:t          j        |          rd}n#t          |d          | j        j        k    rd}nd}n# t          $ r d}Y nw xY w| j        j         }	|s|du s|	r+dt          | j                  v r|                    |           |S )Nr?   r   FTr4   __all__)r   
for_moduler   r3   find_attr_docsr   
members_ofr?   r   AttributeErrorr   r   inspectismoduler>   dirappend)
r-   r   membersanalyzer	attr_docsrO   r   rb   importedrespect_module_alls
             r.   scanzModuleScanner.scan   s   	%01EFFH //11II 	 	 	III	 t{4;??? 	% 	%D$T[$77!    **477GtUG44 
!:**$HH%e,, %#HH!%66$+:NNN#HH$H! ! ! ! ! &*[%N!N !% u$$& %+4DK8H8H+H+Ht$$$s4   27 AA'A==BB>ADDDN)
r   r    r?   r   r@   r"   rA   r   r'   r(   )rO   rN   r   r    r'   rN   )rO   rN   r   r    rb   rN   r'   rH   )r   rH   r'   r   )r3   r4   r5   rI   r   r   r   r+   r1   r.   r   r      sh           S S S S   ") ) ) ) ) )r1   r   r   r    r?   r   Sequence[str]c               r    |j         rt          |           S t          |           x}|S t          |           S )zGet the members of ``obj``, possibly ignoring the ``__all__`` module attribute

    Follows the ``config.autosummary_ignore_module_all`` setting.
    )r>   r   r   )r   r?   obj___all__s      r.   r   r     s<    
 + 3xx!#;;&K33xxr1   parentrR   r   r   rH   rS   r   r   r   rP   qualnamer@   r"   rA   r   c
          	     *   t          |||          }i }|                    |           |j        dk    rmt          ||
||          }|                    |          |d<   |
j         }|pdt          |          v o|}t          ||dh|
|||          \  |d<   |d	<   t          ||d
h|
|||          \  |d<   |d<   t          ||dh|
|||          \  |d<   |d<   t          | |d                   \  |d<   |d<   t          |d          }|r|r|d	         |d         z   |d         z   |d         z   }|r@dt          |          v r/t          ||dh|
||d          \  }}||z  }t          |          }ng g }}d }t          ||| |          \  }}||z   |d<   ||z   |d<   n|j        d
k    rt          |          |d<   t          t          |                    t          |j                                                  z
  |d<   t          ||dh|
||dh          \  |d<   |d<   t          ||ddh|
||          \  |d<   |d<   ||	t          |           \  }}	|j        dv r|	                    d d!          d"         |d
<   |j        d
k    r|	}n|	                    d d!          d#         }| |d$<   ||d<   |	|d%<   ||d&<   |j        |d'<   t#          |           d(z  |d)<   |r|                    ||          S |                    |j        |          S )*Nr   moduler?   r@   rA   r   r   function)r?   r@   rA   r   	functionsall_functionsclassclassesall_classes	exception
exceptionsall_exceptions
attributesall_attributes__path__T)skiprO   public_membersmodulesall_modulesinherited_membersmethodrI   )r?   r@   rA   include_publicmethodsall_methods	attributeproperty>   r   r   r   r   r   r   fullnameobjnamerO   rb   rf   rx   )r   updaterb   r   r   r>   r   _get_members_get_module_attrshasattrr   _get_modulesset__dict__keysr   rsplitrl   r   )rO   r   r   rR   r   r   rS   r   r   r   r?   r@   rA   docnsscannerr   	ispackager   imported_modulesall_imported_modulesr   r   r   	shortnames                            r.   generate_autosummary_contentr   ,  s.     #v
9
9
9CBIIg
{hF6HUUU%5669!'!EE+ 
S!8&8 	 0<L%0
 0
 0
,;O, ,8I%,
 ,
 ,
(9r-( 2>M%2
 2
 2
.<"-. 2C4I1W1W.<"-.C,,	 $	C $	C ?#]#$%&' %&'  " &i3s88&;&;9EJ!!%!: : :6 "6 ,,!'9;R"6 !%#/$T.$ $ $ G[ -w6ByM 4{ BB}			C9"%c#hh--#cl6G6G6I6I2J2J"J+7J&<,
 ,
 ,
(9r-( 2>*%2
 2
 2
.<"-. (*6t<<
{999ooc1--a07
{g		OOC++B/	BzNBxLByMBvJKByM$ii#oB{O 0}b111s{B///r1   rb   c                   	 |                     d||| di           S # t          $ r6}t                              t	          d          ||d           Y d }~dS d }~ww xY wr   )r/   r   r   r   r   )r   rO   rb   r@   r   s        r.   _skip_memberr     s    &&!7D#ub
 
 	
  
 
 
:   	 	
 	
 	
 uuuuu
s    
A+AAc                    t           j        j        j                            | d t
                    }d |                                D             S )Nc                $    i | ]\  }}||j         S r+   )r   ).0rO   members      r.   
<dictcomp>z&_get_class_members.<locals>.<dictcomp>  s     DDDLD&D&-DDDr1   )sphinxrr   autodocimporterget_class_membersr   items)r   r   s     r.   _get_class_membersr     s=    j );;C|TTGDDGMMOODDDDr1   c               z    i }t          | |          D ]&}	 t          | |          ||<   # t          $ r Y #w xY w|S )Nr   )r   r   r   )r   r?   r   rO   s       r.   _get_module_membersr     sb    G3v...  	(d33GDMM 	 	 	H	Ns   +
88r   type[Documenter]c               r    | j         dk    rt          ||          S | j         dk    rt          |          S i S )Nr   r   r   )rb   r   r   )r   r   r?   s      r.   _get_all_membersr    sD     {h"3v6666			!#&&&Ir1   T)r   r   typesset[str]r   Set[str]r   tuple[list[str], list[str]]c                  g }g }	t          | ||          }
|
                                D ]\  }}t          |||          }|j        |v r|st	          |dd           |j        k    rt          |||j        |          }|du rY|du r+|                    |           |	                    |           |                    |           ||v s|                    d          s|	                    |           |	|fS )Nr   r   r4   )r@   TF_)	r  r   r   rb   getattrr3   r   r   
startswith)r   r   r  r?   r@   rA   r   r   r   publicall_membersrO   r   rd   skippeds                  r.   r   r     s%    EF"3F;;;K"((** , ,e$UC(CCC
&& ,75,==MM&udJ4FvVVVd??%%LL&&&MM$''''LL&&&~--T__S5I5I-d+++5=r1   r   c                    g g }}	 t          j        |           }|                                }|D ]J\  }}|sC||v r?|                    |           |                    d          s|                    |           Kn# t
          $ r Y nw xY w||fS )z'Find module attributes with docstrings.r  )r   r   r   r   r	  r   )rO   r   attrsr
  r   r   	namespace	attr_names           r.   r   r     s    6E	!,T22++--	$- 	- 	- Iy -g!5!5Y''' ++C00 -MM),,,		-
    5=s   A5A< <
B	B	)r   r   r   Sequence[str] | Nonec                  g }g }t          j        | j                  D ]\  }}}||v r| d| }		 t          |	          }
|
rt	          |
d          r5n# t
          $ r Y nw xY w|                    |           |||v r|                    |           w|                    d          s|                    |           ||fS )Nr   __sphinx_mock__r  )pkgutiliter_modulesr   r   r   r   r   r	  )r   r   rO   r   r   r
  r  r   _ispkgr   r   s              r.   r   r     s    EF%23<@@ ' '7Fd??&&W&&	"8,,F  '&*;<< 	  	 	 	D	 	W%.((g&&&%%c** 'g&&&5=s   A
A! A!.rstFutf-8sourcesr   
output_dirstr | os.PathLike[str] | Nonesuffix	base_pathSphinx | None	overwriteencoding
list[Path]c                   |
J d            t          |           }t          |          dk    r|dd         dgz   |dd         z   }t                              t	          d          d                    |                     |r(t                              t	          d	          |           t                    fd
| D             }	n"t          t          t          |                     }	t          |          }
t          |	          }g }g }|j        j        }t          t          |          t                    D ]}|j        |p%t          |j                                                  }t#          |           	 t%          |j                  \  }}}}|                    |dz   d          }n# t*          $ r}	 t-          |j                  \  }}}}|                    |dz   d          }n# t.          $ r}|j        rg |j        |j        }ng |j        |}t          d |D                       }t                              t	          d          |j        d                    |                     Y d}~Y d}~Ed}~ww xY wY d}~nd}~ww xY wi |j        j        }t9          ||||
|j        ||j        ||||j        |j        |j                   }t          ||!                    ||          |z             }|"                    |           |#                                r|$                    |          5 }|%                                }ddd           n# 1 swxY w Y   ||k    r7|rY|$                    d|          5 }|&                    |           ddd           n# 1 swxY w Y   |"                    |           tI          |d|          5 }|&                    |           ddd           n# 1 swxY w Y   |"                    |           |r3|'                    tQ          d |D             |||||                     |S )zGenerate autosummary documentation for the given sources.

    :returns: list of generated files (both new and existing ones)
    Nzapp is required   
   z...iz,[autosummary] generating autosummary for: %sz, z[autosummary] writing to %sc                    g | ]}|z  S r+   r+   )r   filenamer  s     r.   
<listcomp>z-generate_autosummary_docs.<locals>.<listcomp>T  s    EEE	H,EEEr1   )keyr   r   c                B    h | ]}d t          |          j         d| S z* z: r   r3   r   rw   s     r.   	<setcomp>z,generate_autosummary_docs.<locals>.<setcomp>{  s2    PPP;DGG$4;;;;PPPr1   z5[autosummary] failed to import %s.
Possible hints:
%srj   r   )r   wc                ,    g | ]}t          |          S r+   )rN   )r   fs     r.   r'  z-generate_autosummary_docs.<locals>.<listcomp>  s    +++AQ+++r1   )r  r  r  r   rU   r  ))sortedrl   r   infor   r   r   listmaprp   find_autosummary_in_filesr?   r=   r   rN   rQ   resolver   r   rO   replacer   r   r   	__cause__r   r   r;   r   rR   rS   r@   rA   getr   is_fileopenreadwriteextendgenerate_autosummary_docs)r  r  r  r  r   rU   r  r   showed_sourcessource_pathsrR   r   	new_files	all_filesfilename_mapentryrQ   rO   r   r   r   r   r   exc2r   errorsr   content	file_pathr0  old_contents      `                           r.   r?  r?  8  s}    ??-???G__N
>R',w69MM
KK
9::DIIn<U<U    CB455zBBBOO	EEEEWEEECg..//"3''H &l33E II:6L E

,,, @( @(: 7T%*--5577$	)7
)C)C&D#vw||GcM266HH# 	 	 	-@-L-L*c67<<#r::   > 96W6W6WJJ!83>!84!8JPPZPPPQQPQQJIIf%%  
  		& #ESZ%C"D.NO::\
 
 
  |//d;;fDEE	### 	(22 'affhh' ' ' ' ' ' ' ' ' ' ' ' ' ' ' +%% ,^^C(^;; %qGGG$$$% % % % % % % % % % % % % % %  +++ix888 !A   ! ! ! ! ! ! ! ! ! ! ! ! ! ! !Y''''  
%+++++%#!1#  
	
 
	
 
	
 ss   2F77
J2G54J5
J?A=J<JJJJM%%M)	,M)	N33N7	:N7	'P		P	P		filenames Sequence[str | os.PathLike[str]]list[AutosummaryEntry]c                    g }| D ]v}t          |dd          5 }|                                                                }ddd           n# 1 swxY w Y   |                    t	          ||                     w|S )z^Find out what items are documented in source/*.rst.

    See `find_autosummary_in_lines`.
    r  ignore)r   rG  Nr&  )r;  r<  
splitlinesr>  find_autosummary_in_lines)rK  
documentedr&  r0  liness        r.   r5  r5    s     *,J O O(WX>>> 	*!FFHH''))E	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*3EHMMMNNNNs   'AA	A	r&  c                   	 t          |           \  }}}}t          j        |                                          }t	          || |          S # t
          $ r Y nt          $ rN}d                    d |j        D                       }t          
                    d|  d|            Y d}~n.d}~wt          $ r t          
                    d|            Y nw xY wg S )znFind out what items are documented in the given object's docstring.

    See `find_autosummary_in_lines`.
    )r   r&  rj   c                B    h | ]}d t          |          j         d| S r*  r+  r,  s     r.   r-  z0find_autosummary_in_docstring.<locals>.<setcomp>  s2    QQQQ8a!188Q88QQQr1   zFailed to import z.
Possible hints:
Nz_Failed to import '%s'; the module executes module level statement and it might call sys.exit().)r   pydocgetdocrQ  rR  r   r   r   r   r   r   
SystemExit)	rO   r&  	real_namer   r   r   rT  r   rG  s	            r.   find_autosummary_in_docstringr[    s   
*8*>*>'	3S!!,,..(thOOOO    O O OQQ#.QQQRRM4MMVMMNNNNNNNN 
 
 
6	
 	
 	
 	
 	

 Is%   AA 
C	C#AB,,(CCrT  r   c           	        t          j        d          }t          j        d          }t          j        d          }t          j        d          }t          j        d          }t          j        d          }t          j        d          }	g }
d}d	}d
}|}d}d
}| D ]k}|r|                    |          }|rd} |                    |          }|r<|                    d          }|r$t	          t          |          j        |z            }s|	                    |          }|r(|                    d                                          }|                                                    d          r|                    |          }|r|                    d                                          	                    d          }|r|                    |dz             s| d| }|

                    t          ||||                     s|                                r|                    |dz             rd}|                    |          }|rd}|                    d          }d}d	}d
}|                    |          }|rM|                    d                                          }|
                    t          ||                     =|                    |          }|r|                    d          }km|
S )a  Find out what items appear in autosummary:: directives in the
    given lines.

    Returns a list of (name, toctree, template) where *name* is a name
    of an object and *toctree* the :toctree: path of the corresponding
    autosummary directive (relative to the root of the file name), and
    *template* the value of the :template: option. *toctree* and
    *template* ``None`` if the directive does not have the
    corresponding options set.
    z^(\s*)\.\.\s+autosummary::\s*z.^\s*\.\.\s+automodule::\s*([A-Za-z0-9_.]+)\s*$z4^\s*\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$z%^\s+(~?[_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?z^\s+:recursive:\s*$z^\s+:toctree:\s*(.*?)\s*$z^\s+:template:\s*(.*?)\s*$FNr   Tr   :~r    rP     )recompilematchgrouprN   r   r   stripr	  removeprefixr   rM   searchr>  r[  )rT  r   r&  autosummary_reautomodule_re	module_reautosummary_item_rerecursive_arg_retoctree_arg_retemplate_arg_rerS  rS   toctreerR   current_modulein_autosummarybase_indentrh   mrO   s                       r.   rR  rR    s'    Z @AANJPQQM
RSSI*%MNNz"899Z <==Nj!>??O)+JIGHNNK 8 8  	# &&t,,A  	$$T**A ''!** C!$x.."7'"ABBG%%d++A 771::++--zz||&&s++ #))$//A wwqzz''))66s;;! 6$//.3:N*O*O 6,55t55D!!"24(I"V"VWWW::<< 4??;3D#E#E "N  && 	!N''!**KIGH  && 	WWQZZ--//N-nxPPP   OOD!! 	WWQZZN	 r1   argparse.ArgumentParserc            
        t          j        dt          d          t          d                    } |                     ddddt          z  	           |                     d
dt          d                     |                     ddddt          d                     |                     dddddt          d                     |                     ddddd t          d                     |                     ddd d!d"t          d#                     |                     d$d%d d&d"t          d'                     |                     d(d d)d"t          d*                     | S )+Nz#%(prog)s [OPTIONS] <SOURCE_FILE>...z:For more information, visit <https://www.sphinx-doc.org/>.a  
Generate ReStructuredText using autosummary directives.

sphinx-autogen is a frontend to sphinx.ext.autosummary.generate. It generates
the reStructuredText files from the autosummary directives contained in the
given input files.

The format of the autosummary directive is documented in the
``sphinx.ext.autosummary`` Python module and can be read using::

  pydoc sphinx.ext.autosummary
)usageepilogdescriptionz	--versionversionshow_versionz%%(prog)s %s)actiondestry  source_file+z&source files to generate rST files for)nargshelpz-oz--output-dirstorer  z directory to place all output in)r{  r|  r  z-sz--suffixr  r   z/default suffix for files (default: %(default)s))r{  r|  defaultr  z-tz--templatesrt   z0custom template directory (default: %(default)s)z-iz--imported-members
store_truer   Fz0document imported members (default: %(default)s)z-az--respect-module-allr   zPdocument exactly the members in module __all__ attribute. (default: %(default)s)z--remove-old
remove_oldzERemove existing files in the output directory that were not generated)argparseArgumentParserr   add_argumentr	   )parsers    r.   
get_parserr  @  s   $3NOO     F" !44	     Sr*R'S'S     233     ABB     BCC     BCC     !%
 
  
 
 
 S
 
     Mr1   r+   argvc                  t          j        t           j        d           t          j                                          t          t          j                                                   }t          j        |t          j
        t          j                   t          |           t                                          | pt          j        dd                    }|j        rP|j        j                            t)          t+          |j                                                                       |j         |j        _        t3          |j        |j        d|j        z   |j        |          }|j        rt+          |j                                      d|j                   D ]e}||vr]	 |                                  # tB          $ r:}tD          #                    tI          d          ||j%        d           Y d }~[d }~ww xY wdd S d S )	Nr   r   r   )r   rU   z**/*.zFailed to remove %s: %srs   r   )&locale	setlocaleLC_ALLr   init_consoler7   get_translatorr   setupsysstdoutstderrre   r  
parse_argsr  rt   r?   r|   r   rN   r   r6  r   r>   r?  r}  r  r  r   r  globunlinkOSErrorr   r   r   strerror)r  rU   r&   written_filesexistingr   s         r.   mainr    s   
V]B'''
M   
6=7799
:
:CM#sz3:...c<<""4#738ABB<88D~ N
!((T$.-A-A-I-I-K-K)L)LMMM373J/JCJ,-dk.  M  T_--223H4;3H3HII 
	 
	H},,OO%%%%   NN455 *	 #         - 
	 
	s   (F==
H0G<<H__main__r   r   )rf   )rg   rN   rh   rN   r'   rN   )rO   rN   r'   r   )r   r    r?   r   r'   r   )NN)rO   rN   r   r    r   r    rR   rp   r   rN   r   rH   rS   rH   r   r   r   rP   r   rP   r?   r   r@   r"   rA   r   r'   rN   )
r   r    rO   rN   rb   rN   r@   r"   r'   rH   )r   r    r'   r   )r   r    r?   r   r'   r   )r   r   r   r    r?   r   r'   r   )r   r   r   r    r  r  r?   r   r@   r"   rA   r   r   r  r   rH   r'   r  )rO   rN   r   r    r'   r  )
r   r    r   r   rO   rN   r   r  r'   r  )Nr  NFNTr  )r  r   r  r  r  rN   r  r  r   rH   rU   r  r  rH   r   rN   r'   r!  )rK  rL  r'   rM  r*   )rO   rN   r&  r  r'   rM  )rT  r   r   rP   r&  r  r'   rM  )r'   rt  )r+   )r  r   r'   r(   )_rK   
__future__r   r  r   r   r  r  rW  ra  r  pathlibr   typingr   r   jinja2r   jinja2.sandboxr   sphinx.localer   r	   r
   sphinx.buildersr   sphinx.configr   sphinx.errorsr   sphinx.ext.autodoc.importerr   sphinx.ext.autosummaryr   r   r   r   r   sphinx.pycoder   sphinx.registryr   sphinx.utilr   r   sphinx.util._pathlibr   sphinx.util.inspectr   r   sphinx.util.osutilr   sphinx.util.templater   oscollections.abcr   r   gettextr   r    sphinx.applicationr!   sphinx.eventsr"   r`   r#   	getLoggerr3   r   r%   r7   rM   re   rn   rp   r   r   r   r   r   r   r   r  	frozensetr   r   r   r?  r5  r[  rR  r  r  r  r+   r1   r.   <module>r     s    # " " " " "          				 



       , , , , , , , , # # # # # # / / / / / /     3 3 3 3 3 3 3 3 # # # # # #             % % % % % % 5 5 5 5 5 5                  ( ( ( ( ( ( 3 3 3 3 3 3 $ $ $ $ $ $ $ $ ) ) ) ) ) ) 4 4 4 4 4 4 4 4 ( ( ( ( ( ( 5 5 5 5 5 5 .III--------(((((())))))******------		8	$	$       
       ,    z   D D D D8, , , , ,%( %( %( %( %( %( %( %(P   BK K K K K K K K\   0 K0 K0 K0 K0 K0\   $E E E E
      $  )y{{           F   * ,0     D 15/3"| | | | |D   " /3    8 .2Z Z Z Z ZzQ Q Q Qh         F zD!"" r1   