+
    ~j                         R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^RIH	t	H
t
 R R ltR R ltR R	 ltR
 R lt ! R R]P                  4      tR R ltR# )zbAttribute docstrings parsing.

.. seealso:: https://peps.python.org/pep-0257/#what-is-a-docstring
N)
ModuleType)	DocstringDocstringParamc                X    V ^8  d   QhR\         P                  R\        P                  /#    nodereturn)astASTTAny)formats   "m/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/docstring_parser/attrdoc.py__annotate__r      s"     " " "QUU "    c                    \        V R4      # )z<Return the constant's value if the given node is a constant.value)getattrr   s   &r   ast_get_constant_valuer      s    4!!r   c                n    V ^8  d   QhR\         P                  R\        P                  \        ,          /# r   )r
   r   r   Optionalstr)r   s   "r   r   r      s&     	 	cgg 	!**S/ 	r   c                   \        \        R4      '       d   \        P                  ! V 4      # \        V \        P                  4      '       d   \        \        V 4      4      # \        V \        P                  4      '       d   V P                  # R# )z0Convert the AST node to source code as a string.unparseN)	hasattrr
   r   
isinstanceConstantr   r   Nameidr   s   &r   ast_unparser!      s]    sI{{4  $%%)$/00$!!wwr   c                D    V ^8  d   QhR\         P                  R\        /# r   )r
   r   bool)r   s   "r   r   r       s      SWW  r   c                    \        V \        P                  4      ;'       dP    \        V P                  \        P                  4      ;'       d$    \        \        V P                  4      \        4      # )z2Return True if the given node is a literal string.)r   r
   Exprr   r   r   r   r   s   &r   ast_is_literal_strr&       sU     	4" 	@ 	@tzz3<<0	@ 	@-djj93?r   c          	         V ^8  d   QhR\         P                  R\        P                  \        P                  \
        \        P                  \
        ,          \        P                  \
        ,          3,          ,          /# r   )r
   r   r   r   Tupler   )r   s   "r   r   r   )   sI      
''ZZQZZ_ajjo=>?r   c                    \        V \        P                  \        P                  34      '       d   \        V \        P                  4      '       d   V P                  ^ ,          MV P
                  p\        V\        P                  4      '       do   Rp\        V \        P                  4      '       d   \        V P                  4      pRpV P                  '       d   \        V P                  4      pVP                  W#3# R# )z@Return name, type and default if the given node is an attribute.N)r   r
   Assign	AnnAssigntargetstargetr   r!   
annotationr   r    )r   r-   type_strdefaults   &   r   ast_get_attributer1   )   s     $S]]344)$

;;DLLO 	 fchh''H$..&t7Gzzz%djj199h//r   c                   D   a  ] tR t^<t o RtRtRtR tV 3R lR ltRt	V t
R# )AttributeDocstringsz6An ast.NodeVisitor that collects attribute docstrings.Nc                Z   V P                   '       dF   \        V4      '       d5   V P                   w  r#p\        VP                  4      VV3V P                  V&   \        V4      V n         \        V\        P                  \        P                  34      '       d   V P                  V4       R # R # N)	prev_attrr&   r   r   	attr_docsr1   r   r
   ClassDefModulegeneric_visit)selfr   	attr_name	attr_typeattr_defaults   &&   r   visitAttributeDocstrings.visitB   s    >>>06615.I,&tzz2)DNN9%
 +40dS\\3::677t$ 8r   c          
         < V ^8  d   QhRS[ P                  RS[ P                  S[S[ P                  S[S[ P
                  S[,          S[ P
                  S[,          3,          3,          /# )r   	componentr	   )r   r   Dictr   r(   r   )r   __classdict__s   "r   r    AttributeDocstrings.__annotate__N   sO      	
QWWS!**S/1::c?BCC	Dr   c                H   / V n         RV n         \        P                  ! \        P
                  ! V4      4      p\        P                  ! V4      p\        P                  ! V4      '       d   V P                  V4       V P                   # \        V\        P                  4      '       dT   \        VP                  ^ ,          \        P                  4      '       d#   V P                  VP                  ^ ,          4       V P                   #   \         d     T P                   # i ; i)zGet attribute docstrings from the given component.

:param component: component to process (class or module)
:returns: for each attribute docstring, a tuple with (description,
    type, default)
N)r7   r6   textwrapdedentinspect	getsourcer
   parseismoduler?   r   r9   bodyr8   OSError)r;   rB   sourcetrees   &&  r   get_attr_docs!AttributeDocstrings.get_attr_docsN   s     	)__W%6%6y%ABF 99V$D	**

4 
 ~~	 D#**--*		!cll3 3 

499Q<(~~  	 ~~	s   *D D! D!)r7   r6   )__name__
__module____qualname____firstlineno____doc__r7   r6   r?   rQ   __static_attributes____classdictcell__)rD   s   @r   r3   r3   <   s!     @II
% r   r3   c                j    V ^8  d   QhR\         P                  \        \        3,          R\        RR/# )r   obj	docstringr	   N)r   Uniontyper   r   )r   s   "r   r   r   h   s2     ) )	
z!	")/8)	)r   c           
        \        R VP                   4       4      p\        4       P                  V 4      P	                  4        FA  w  pw  rEpW29  g   K  \        RV.VVVVRJVR7      pVP                  P                  V4       KC  	  R# )zAdd attribute docstrings found in the object's source code.

:param obj: object from which to parse attribute docstrings
:param docstring: Docstring object where found attributes are added
:returns: list with names of added attributes
c              3   8   "   T F  qP                   x  K  	  R # 5ir5   )arg_name).0ps   & r   	<genexpr>+add_attribute_docstrings.<locals>.<genexpr>q   s     6%5%5s   	attributeN)argsdescriptionra   	type_nameis_optionalr0   )setparamsr3   rQ   itemsr   metaappend)r[   r\   rl   ra   rh   ri   r0   params   &&      r   add_attribute_docstringsrq   h   s     6Y%5%566F++C0668 	43;7 !"!8,'!##4/E NN!!%( 	9r   )rW   r
   rI   rG   typingr   typesr   commonr   r   r   r!   r&   r1   NodeVisitorr3   rq    r   r   <module>rw      sH   
      -"
	&)#// )X)r   