
    lj&                       U d Z ddlmZ ddlZddlZddlmZmZmZ ddlm	Z	 ddl
mZmZ dgZeeef         Zded	<   	 eeef         Zded
<   	 eeef         Zded<   	 eeef         Zded<   	 eeef         Zded<   	 eeee         f         Zded<   	 eeef         Zded<   	 i aded<   i aded<   i aded<    e	e                                          j        j        j        ZddZ dS )zIRead and parse all the Manim modules and extract documentation from them.    )annotationsN)	AttributeName	Subscript)Path)Any	TypeAliasparse_module_attributesr	   	AliasInfoAliasCategoryDictModuleLevelAliasDictModuleTypeVarDictAliasDocsDictDataDictTypeVarDictALIAS_DOCS_DICT	DATA_DICTTYPEVAR_DICTreturn+tuple[AliasDocsDict, DataDict, TypeVarDict]c                 l   t           st          st          rt           t          t          fS t                              d          D ]} |                                                     t                    }t          |j                  }|d         	                    d          |d<   d
                    |          }|                     d          }i }d}d}i }g }	d}
t          j        t          j        |                    D ]}t          |          t          j        u rt          |j                  t          j        u rt          |j        j                  t&          u r|j        j                                        }d}|                    |          r9|t-          |          d                                         }i ||<   ||         }d}n|r||d	<   n|
r|	                    |
           t          |          t          j        u rt          |j                  t          j        u r|j        j        d
k    sjt          |j                  t          j        u rRt          |j        j                  t          j        u r-|j        j        j        dk    r|j        j        d
k    r|j        }n|g}|D ]&}t>          j         dk    ot          |          t          j!        u }t          |          t          j"        u oXt          |j#                  t          j        u o8|j#        j        dk    o(t          |j$                  t          j        u o|j        du}|s|r|r|j%        j        n|j$        j        }|j        }t          |          t          j&        u r\t          |j                  t          j        u r<|j        j        dk    r,|j'        j(        }d
                    d |D                       }nt          j)        |          }|*                    dd          }|i |d<   |d         }d|i||<   ||         }t          |          t          j+        u rt          |j,        d                   t          j        u rt          |j                  t          j-        u rt          |j        j.                  t          j        u rf|j        j.        j        /                    d          rBt          j)        |j                  *                    dd          ||j,        d         j        <   td}t          |          t          j"        u r|j$        }nCt          |          t          j+        u r&t-          |j,                  dk    r|j,        d         }nd}t          |          t          j        u r-t          |          t          j+        u r	|j        |vs	|j        }
$d}
(t-          |          dk    r
|t           |<   t-          |	          dk    r
|	t          |<   |r
|t          |<   t           t          t          fS )a  Read all files, generate Abstract Syntax Trees from them, and
    extract useful information about the type aliases defined in the
    files: the category they belong to, their definition and their
    description, separating them from the "regular" module attributes.

    Returns
    -------
    ALIAS_DOCS_DICT : :class:`AliasDocsDict`
        A dictionary containing the information from all the type
        aliases in Manim. See :class:`AliasDocsDict` for more information.

    DATA_DICT : :class:`DataDict`
        A dictionary containing the names of all DOCUMENTED
        module-level attributes which are not a :class:`TypeAlias`.

    TYPEVAR_DICT : :class:`TypeVarDict`
        A dictionary containing the definitions of :class:`TypeVar` objects,
        organized by modules.
    z*.pyz.py.zutf-8)encodingNz
[CATEGORY]docTYPE_CHECKINGtyping)      r	   Unionz | c              3  >   K   | ]}t          j        |          V  d S )N)astunparse).0elems     ^/home/agentuser/manim-venv/lib/python3.11/site-packages/manim/utils/docbuild/module_parsing.py	<genexpr>z*parse_module_attributes.<locals>.<genexpr>   s=       0 026CK--0 0 0 0 0 0    znpt. 
definitionr   TypeVar_z\_   )0r   r   r   
MANIM_ROOTrglobresolverelative_tolistpartsremovesuffixjoin	read_textr"   iter_child_nodesparsetypeExprvalueConstantstrstrip
startswithlenappendIftestr   idr   attrbodysysversion_infor	   	AnnAssign
annotationtargetnamer   sliceeltsr#   replaceAssigntargetsCallfuncendswith)module_pathmodule_name_t1module_name_t2module_namemodule_contentmodule_dictcategory_dict
alias_infomodule_typevars	data_list	data_namenodestringsection_strcategory_nameinner_nodesis_type_alias"is_annotated_assignment_with_value
alias_namedefinition_nodeunion_elementsr*   rK   s                          r&   r
   r
   >   s   0  8) 8| 8	<77!''// X8 X8$,,..:::FFn233+B/<<UCCrhh~..$...@@ -/26'+
 .0  "	 $	(>)B)BCC }	% }	%D T

ch&&$$44)**c11)//11*$$[11 
0$*3{+;+;+=+=$>$D$D$F$FM13K.$/$>M!%JJ 0(.Ju%% 0$$Y/// T

cf$$ TY3833	8W8W TY3=88 11SX== IO.(:: INo== *.#f# I% I% $/ODJJ#-4O  JJ#-/ /T_--9/*k9/ T[))SX5/ 
$. 3 ! ($F ( 2?!RDKNJ&*jO
 _-->> !67738CC+14??)8)>)C%*ZZ 0 0:H0 0 0 & &

 &)[%A%A
!+!3!3FB!?!?J$,*,B(3B1=z0JM*-!.z!:J JJ#*,,T\!_--99TZ((CH44TZ_--99
*33I>> : ;>+
; ;gc5)) $DLO$67  "

 ::..MQ[FF$ZZ3:--#dl2C2Cq2H2H!\!_FF!F<<38++JJ#*,,/1Q1Q &	II $IISI%V {a+6OK(y>>A%.Ik" 	8(7L%I|33r(   )r   r   )!__doc__
__future__r   r"   rG   r   r   r   pathlibr   r   r   r	   __all__dictr=   r   __annotations__r   r   r   r   r2   r   r   r   r   r   __file__r0   parentr.   r
    r(   r&   <module>rs      s   O O O " " " " " " 



 



 * * * * * * * * * *       ! ! ! ! ! ! ! !$
% CH~	 % % % %
  $CN3  3 3 3 3 #'s,='=">  > > > >  $CH~  - - - - G  %9 9: : : : :
 3S	>* * * * * c#445 5 5 5 5 T!# # # # #	        T(^^##%%,3:
u4 u4 u4 u4 u4 u4r(   