
    5j                        % S r SSKJr  SSKrSSKrSSKJr  SSKrSSKJ	r	  \R                  (       a  SrS\S	'   S
rS\S'    " S S\5      r " S S5      rSS jrg)z:Tools to provide pretty/human-readable display of objects.    )annotationsN)Any   )_typing_extraz'typing.Iterable[tuple[str | None, Any]]ztyping_extensions.TypeAliasReprArgszJtyping.Iterable[Any | tuple[Any] | tuple[str, Any] | tuple[str, Any, Any]]RichReprResultc                  "    \ rS rSrSrSS jrSrg)	PlainRepr   zString class where repr doesn't include quotes. Useful with Representation when you want to return a string
representation of something that is valid (or pseudo-valid) python.
c                    [        U 5      $ N)strselfs    W/root/lseg-credit/backend/venv/lib/python3.13/site-packages/pydantic/_internal/_repr.py__repr__PlainRepr.__repr__   s    4y     Nreturnr   )__name__
__module____qualname____firstlineno____doc__r   __static_attributes__r   r   r   r
   r
      s    r   r
   c                  ^    \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS jr
SS	 jrSrg
)Representation   r   c                   ^  T R                   nU(       d+  [        T S5      (       a  T R                  R                  5       nU 4S jU 5       nU VVs/ s H  u  p4Uc  M
  X44PM     snn$ s  snnf )a  Returns the attributes to show in __str__, __repr__, and __pretty__ this is generally overridden.

Can either return:
* name - value pairs, e.g.: `[('foo_name', 'foo'), ('bar_name', ['b', 'a', 'r'])]`
* or, just values, e.g.: `[(None, 'foo'), (None, ['b', 'a', 'r'])]`
__dict__c              3  >   >#    U  H  o[        TU5      4v   M     g 7fr   )getattr).0sr   s     r   	<genexpr>/Representation.__repr_args__.<locals>.<genexpr>0   s     <1WT1%&s   )	__slots__hasattrr"   keys)r   attrs_namesattrsavs   `    r   __repr_args__Representation.__repr_args__&   sY     nnwtZ88--,,.K<<#(:541A5:::s   	A)A)c                .    U R                   R                  $ )z/Name of the instance's class, used in __repr__.)	__class__r   r   s    r   __repr_name__Representation.__repr_name__3   s    ~~&&&r   c                N    UR                  S U R                  5        5       5      $ )Nc              3  R   #    U  H  u  pUc  [        U5      OU SU< 3v   M     g 7f)N=)repr)r%   r.   r/   s      r   r'   .Representation.__repr_str__.<locals>.<genexpr>8   s+     ePd	T!W!AaU|CPds   %')joinr0   )r   join_strs     r   __repr_str__Representation.__repr_str__7   s!    }}ePTPbPbPdeeer   c              +     #    U R                  5       S-   v   Sv   U R                  5        H!  u  p4Ub  US-   v   U" U5      v   Sv   Sv   M#     Sv   Sv   g7f)	zRUsed by devtools (https://python-devtools.helpmanual.io/) to pretty print objects.(r   Nr8   ,r   ))r4   r0   )r   fmtkwargsnamevalues        r   
__pretty__Representation.__pretty__:   sc       "S((--/KDSj e*IG 0 	s   AAc              #  Z   #    U R                  5        H  u  pUc  Uv   M  X4v   M     g7f)zYUsed by Rich (https://rich.readthedocs.io/en/stable/pretty.html) to pretty print objects.N)r0   )r   rF   
field_reprs      r   __rich_repr__Representation.__rich_repr__G   s/      $ 2 2 4D|  &&	 !5s   )+c                $    U R                  S5      $ )N )r=   r   s    r   __str__Representation.__str__O   s      %%r   c                L    U R                  5        SU R                  S5       S3$ )Nr@   , rC   )r4   r=   r   s    r   r   Representation.__repr__R   s+    $$&'q):):4)@(ACCr   N)r   r   r   )r<   r   r   r   )rD   ztyping.Callable[[Any], Any]rE   r   r   z!typing.Generator[Any, None, None])r   r   )r   r   r   r   r)   r0   r4   r=   rH   rL   rP   r   r   r   r   r   r   r      s.     I;'f'&Dr   r   c                   [        U [        R                  5      (       a  U R                  $ U SL a  g[        U [        5      (       a  [        U 5      $ [        U [        R                  5      (       a  [        U 5      $ [        U [        R                  [        R                  [        45      (       d  U R                  n [        R                  " [        R                  " U 5      5      (       a9  SR!                  [#        [$        [        R&                  " U 5      5      5      nSU S3$ [        U [        R                  5      (       a  [        R                  " U 5      [        R(                  :X  a4  SR!                  [#        [
        [        R&                  " U 5      5      5      nO3SR!                  [#        [$        [        R&                  " U 5      5      5      n U R*                   SU S3$ [        U [        5      (       a  U R*                  $ [        U 5      R/                  SS5      R/                  S	S5      $ ! [,         a    [        U 5      s $ f = f)
zPretty representation of a type, should be as close as possible to the original type definition string.

Takes some logic from `typing._type_repr`.
.z...rS   zUnion[][ztyping. ztyping_extensions.)
isinstancetypesFunctionTyper   r   r9   typing_extensionsTypeAliasTyper   r   typing_baseWithArgsTypestyper3   origin_is_union
get_originr;   mapdisplay_as_typeget_argsLiteralr   AttributeErrorreplace)objargss     r   rd   rd   V   s   
 #u))**||		C	(	(Cy	C*88	9	93xcM55}7R7RTXYZZmm$$%6%A%A#%FGGyy_.?.H.H.MNOvQ	C44	5	5'',0A0I0II99S'8'A'A#'FGHD99S2C2L2LS2QRSD	&&'qa00 
C		Cy  B/778LbQQ  	s8O	s   H1 1I	I	)ri   r   r   r   )r   
__future__r   _annotationsrZ   typingr   r\   rX   r   TYPE_CHECKINGr   __annotations__r   r   r
   r   rd   r   r   r   <module>rp      s]    @ 2     	,UH)UT / 
 6D 6Dr Rr   