L iz pdZddlZddlZddlmZmZmZmZddl m Z ddl m Z m Z mZmZe j ee j"ee j$ee j&eiZe j*fdede de fd Ze j*fd ej0de de fd Ze j*ej4d fd e de dededef dZy)zThe main parsing routine.N)epydocgooglenumpydocrest)add_attribute_docstrings) DocstringDocstringStyle ParseErrorRenderingStyletextstylereturnc4|tjk7rt|j|Sd}g}tj D]%} |j|}|j |'|s|t|dddS#t $r }|}Yd}~Nd}~wwxYw)zParse the docstring into its components. :param text: docstring text to parse :param style: docstring style :returns: parsed docstring representation Nc,t|jS)N)lenmeta)ds ]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/docstring_parser/parser.pyzparse...sc!&&kT)keyreverser)r AUTO _STYLE_MAPparsevaluesappendr sorted)r r excretsmoduleretexs rrrs ###% &&t,,!%C D##% ,,t$C KK    $14 @ CC C sB B BBobjct|j|}tj|stj|r t |||S)aQParse the object's docstring(s) into its components. The object can be anything that has a ``__doc__`` attribute. In contrast to the ``parse`` function, ``parse_from_object`` is able to parse attribute docstrings which are defined in the source code instead of ``__doc__``. Currently only attribute docstrings defined at class and module levels are supported. Attribute docstrings defined in ``__init__`` methods are not supported. When given a class, only the attribute docstrings of that class are parsed, not its inherited classes. This is a design decision. Separate calls to this function should be performed to get attribute docstrings of parent classes. :param obj: object from which to parse the docstring(s) :param style: docstring style :returns: parsed docstring representation )r )r__doc__inspectisclassismoduler)r$r docstrings rparse_from_objectr+1s=.ckk/Isw//4 i0 rz r*rendering_styleindentczt|tjk(r |jn|}|j |||S)aRender a parsed docstring into docstring text. :param docstring: parsed docstring representation :param style: docstring style to render :param indent: the characters used as indentation in the docstring string :returns: docstring text )r,r-)rr rr compose)r*r r,r-r!s rr/r/PsC N$7$77 UF >>?6  r)r&r'typingTdocstring_parserrrrrdocstring_parser.attrdocrdocstring_parser.commonrr r r RESTGOOGLENUMPYDOCEPYDOCrrstrrAnyr+COMPACTr/rrr=s;;=6X6  .<-@-@DDNDYD8+//  B+//&4&<&<  $    r