+
    7*i  c                  s    R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt  ! R R]P                  4      t
R R ltR R	 ltRR
 R lltR# )z4Utilities related to attribute docstring extraction.)annotationsN)Anyc                  sX   a  ] tR t^tR V 3R lltR V 3R lltR R ltR R ltR	tV ;t	# )
DocstringVisitorc               s    V ^8  d   QhRR/# )   returnZNone Zformat   "H/usr/lib/python3.14/site-packages/pydantic/_internal/_docs_extraction.py__annotate__DocstringVisitor.__annotate__   s     = =$ =    c                	sN   < \         SV `  4        R V n        / V n        R V n        R # N)super__init__targetattrsprevious_node_type)self	__class__s   &r   r   ZDocstringVisitor.__init__   s$    "&%'
8<r   c                    V ^8  d   QhRRRR/# )r   nodezast.ASTr   r   r   r   r   r   r	   r
      s      ' c r   c                	sF   < \         SV `  V4      p\        V4      V n        V# r   )r   visitZtyper   )r   r   Znode_resultr   s   && r   r   ZDocstringVisitor.visit   s#    gmD)"&t*r   c               r   )r   r   zast.AnnAssignr   r   r   r   r   r   r	   r
      s     ) )M )c )r   c                	s    \        VP                  \        P                  4      '       d   VP                  P                  V n        R # R # r   )
isinstancer   astZNameZid)r   r   s   &&r   visit_AnnAssignZ DocstringVisitor.visit_AnnAssign   s+    dkk388,,++..DK -r   c               r   )r   r   zast.Exprr   r   r   r   r   r   r	   r
      s     	 	x 	C 	r   c                	s   \        VP                  \        P                  4      '       d   \        VP                  P                  \        4      '       d~   V P
                  \        P                  J d^   \        P                  ! VP                  P                  4      pV P                  '       d   W P                  V P                  &   R V n	        R # R # R # R # r   )r   Zvaluer   ZConstantstrr   Z	AnnAssigninspectZcleandocr   r   )r   r   Z	docstrings   && r   
visit_ExprZDocstringVisitor.visit_Expr   s    tzz3<<004::++S11''3==8(()9)9:I{{{*3

4;;'DK 9 2 1r   )r   r   r   )
__name__Z
__module__Z__qualname__Z__firstlineno__r   r   r   r   Z__static_attributes__Z__classcell__)r   s   @r   r   r      s&    = = 
)	 	r   r   c               r   )r   sourcez	list[str]r   r   r   r   r   r   r	   r	   )   s       s r   c                s    \         P                  ! R P                  V 4      4      pVP                  R4      '       d   RV 2pV# )Z zdef dedent_workaround():
)Z Z	)textwrapZdedentZjoinZ
startswith)r   dedent_sources   & r   _dedent_source_linesr!   )   s=    OOBGGFO4M,, 5]ODr   c               r   )r   cls	type[Any]r   zlist[str] | Noner   r   r   r   r	   r	   4   s      I 2B r   c                s   \         P                  ! 4       pV'       Ed8   \         P                  ! V4      \         P                  ! V 4      J d   VP                  p \         P                  ! V4      w  r4\         P
                  ! W2^,
          R 4      p\        V4      p \        P                  ! V4      pVP                  ^ ,          p\        V\        P                  4      '       d%   VP                  R8X  d   VP                  ^ ,          p\        V\        P                  4      '       d   VP                  V P                  8X  d   V# VP"                  pEK@  R#   \         d     Li ; i  \          d     L/i ; i)i   NZdedent_workaround)r   ZcurrentframeZ	getmoduleZf_linenoZ
findsourceZgetblockr!   r   parseZbodyr   ZFunctionDefZnameZClassDefr   ZSyntaxErrorOSErrorZf_back)	r"   ZframeZlnumZlines_Zblock_linesr    Z
block_treeZstmts	   &        r   _extract_source_from_framer'   4   s"     "E
%U#w'8'8'==>>D+"--e4 &..uAXZ/@A 4[ A
+!$=!9J &??1-D!$88TYYJ]=]#yy|!$55$))s||:S**1  #    s$   E) E E&%E&)E76E7c               s$    V ^8  d   QhRRRRRR/# )r   r"   r#   use_inspectZboolr   zdict[str, str]r   r   r   r   r	   r	   R   s!      Y T n r   c                sL   V'       g   \         P                  R8  d    \        P                  ! V 4      w  r#M\        V 4      pV'       g   / # \        V4      p\        4       pVP                  \        P                  ! V4      4       VP                  #   \         d    / u # i ; i)a<  Map model attributes and their corresponding docstring.

Args:
    cls: The class of the Pydantic model to inspect.
    use_inspect: Whether to skip usage of frames to find the object and use
        the `inspect` module instead.

Returns:
    A mapping containing attribute names and their corresponding docstring.
)i   i   )sysZversion_infor   Zgetsourcelinesr%   r'   r!   r   r   r   r$   r   )r"   r(   r   r&   r    Zvisitors   &&    r   extract_docstrings_from_clsr*   R   s     c&&'1
	..s3IFA
 ,C0	(0M GMM#))M*+==  	I	s   B B#"B#)F)Z__doc__Z
__future__r    r   r   r)   r   Ztypingr   ZNodeVisitorr   r!   r'   r*   r   r   r   <module>r+      s>    : " 
  
  s :< r   