
    iD                    (   S SK Jr  S SKrS SKJr  S SKJrJrJr  S SK	J
r
  S SKJrJrJr  S SKJr  \(       a  S SKJr  S S	KJrJrJrJrJrJrJr  \" S
5      rSS jr " S S5      r " S S5      r " S S5      r " S S5      r  " S S\\\\ 5      r!g)    )annotationsN)suppress)TYPE_CHECKINGAnyTypeVar)Kind)AliasResolutionErrorBuiltinModuleErrorCyclicAliasError)merge_stubs)Sequence)Alias	AttributeClassFunctionModuleObject	TypeAlias_ObjTypec                    [        U [        5      (       a$  U (       d  [        S5      eU R                  S5      nO[	        U 5      nU(       d  [        S5      eU$ )NzEmpty strings are not supported.zEmpty tuples are not supported)
isinstancestr
ValueErrorsplitlist)keypartss     Q/home/james-whalen/.local/lib/python3.13/site-packages/griffe/_internal/mixins.py
_get_partsr       sH    #s>??		#S	9::L    c                  ,    \ rS rSrSrSS jrSS jrSrg)GetMembersMixin"   z3Mixin class to share methods for accessing members.c                    [        U5      n[        U5      S:X  a  U R                  US      $ U R                  US      USS    $ )a  Get a member with its name or path.

This method is part of the consumer API:
do not use when producing Griffe trees!

Members will be looked up in both declared members and inherited ones,
triggering computation of the latter.

Parameters:
    key: The name or path of the member.

Examples:
    >>> foo = griffe_object["foo"]
    >>> bar = griffe_object["path.to.bar"]
    >>> qux = griffe_object[("path", "to", "qux")]
   r   N)r    lenall_membersselfr   r   s      r   __getitem__GetMembersMixin.__getitem__%   sM    " 3u:?##E!H--a)%)44r!   c                    [        U5      n[        U5      S:X  a  U R                  US      $ U R                  US      R                  USS 5      $ )a  Get a member with its name or path.

This method is part of the producer API:
you can use it safely while building Griffe trees
(for example in Griffe extensions).

Members will be looked up in declared members only, not inherited ones.

Parameters:
    key: The name or path of the member.

Examples:
    >>> foo = griffe_object["foo"]
    >>> bar = griffe_object["path.to.bar"]
    >>> bar = griffe_object[("path", "to", "bar")]
r&   r   N)r    r'   members
get_memberr)   s      r   r/   GetMembersMixin.get_member;   sO    " 3u:?<<a))||E!H%00qr;;r!    N)r   str | Sequence[str]returnr   )__name__
__module____qualname____firstlineno____doc__r+   r/   __static_attributes__r1   r!   r   r#   r#   "   s    =5,<r!   r#   c                  ,    \ rS rSrSrSS jrSS jrSrg)DelMembersMixinT   z2Mixin class to share methods for deleting members.c                    [        U5      n[        U5      S:X  a  US   n U R                  U	 gU R
                  US      USS 	 g! [         a    U R                  U	  gf = f)a  Delete a member with its name or path.

This method is part of the consumer API:
do not use when producing Griffe trees!

Members will be looked up in both declared members and inherited ones,
triggering computation of the latter.

Parameters:
    key: The name or path of the member.

Examples:
    >>> del griffe_object["foo"]
    >>> del griffe_object["path.to.bar"]
    >>> del griffe_object[("path", "to", "qux")]
r&   r   N)r    r'   r.   KeyErrorinherited_membersr(   r*   r   r   names       r   __delitem__DelMembersMixin.__delitem__W   sp    " 3u:?8D1LL&   q*595  1**401s   A A A c                    [        U5      n[        U5      S:X  a  US   nU R                  U	 gU R                  US      R                  USS 5        g)a  Delete a member with its name or path.

This method is part of the producer API:
you can use it safely while building Griffe trees
(for example in Griffe extensions).

Members will be looked up in declared members only, not inherited ones.

Parameters:
    key: The name or path of the member.

Examples:
    >>> griffe_object.del_member("foo")
    >>> griffe_object.del_member("path.to.bar")
    >>> griffe_object.del_member(("path", "to", "qux"))
r&   r   N)r    r'   r.   
del_memberr@   s       r   rE   DelMembersMixin.del_memberr   sN    " 3u:?8DT"LLq"--eABi8r!   r1   N)r   r2   r3   None)r4   r5   r6   r7   r8   rB   rE   r9   r1   r!   r   r;   r;   T   s    <669r!   r;   c                  ,    \ rS rSrSrSS jrSS jrSrg)SetMembersMixin   z1Mixin class to share methods for setting members.c                    [        U5      n[        U5      S:X  a2  US   nX R                  U'   U R                  (       a  Xl        gXl        gX R                  US      USS '   g)aO  Set a member with its name or path.

This method is part of the consumer API:
do not use when producing Griffe trees!

Parameters:
    key: The name or path of the member.
    value: The member.

Examples:
    >>> griffe_object["foo"] = foo
    >>> griffe_object["path.to.bar"] = bar
    >>> griffe_object[("path", "to", "qux")] = qux
r&   r   N)r    r'   r.   is_collection_modules_collectionparent)r*   r   valuer   rA   s        r   __setitem__SetMembersMixin.__setitem__   s\     3u:?8D!&LL!!,0)#05LLq"59-r!   c                t   [        U5      n[        U5      S:X  GaD  US   nX@R                  ;   Ga  U R                  U   nUR                  (       d  UR                  (       a  UR
                  (       d  UR                  (       dp  [        [        [        [        5         UR                  (       a=  UR                  UR                  :w  a#  [        [        5         [        XR5      nSSS5        SSS5        UR                  R                  5        H!  n[        [        5         X&l        SSS5        M#     X R                  U'   U R"                  (       a  Xl        gXl        gU R                  US      R)                  USS U5        g! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       M  = f)a  Set a member with its name or path.

This method is part of the producer API:
you can use it safely while building Griffe trees
(for example in Griffe extensions).

Parameters:
    key: The name or path of the member.
    value: The member.

Examples:
    >>> griffe_object.set_member("foo", foo)
    >>> griffe_object.set_member("path.to.bar", bar)
    >>> griffe_object.set_member(("path", "to", "qux"), qux)
r&   r   N)r    r'   r.   is_alias	is_moduleis_namespace_packageis_namespace_subpackager   r	   r   r
   filepathr   r   aliasesvaluestargetrL   rM   rN   
set_member)r*   r   rO   r   rA   memberaliass          r   r[   SetMembersMixin.set_member   s0     3u:?8D||#d+ ''1L1LPVPnPn &&:<LN`a$5>>V__3T%-j%9,7,FE &: b "(!6!6!8%&67+0L 87 "9 "'LL!!,0)#LLq"--eABi? &:%9 ba
 87s0   ;FF$F F(
F	F
F%(
F7	r1   N)r   r2   rO   zObject | Aliasr3   rG   )r4   r5   r6   r7   r8   rP   r[   r9   r1   r!   r   rI   rI      s    ;64)@r!   rI   c                  >    \ rS rSrSrSS.S	S jjr\S
S j5       rSrg)SerializationMixin   z8Mixin class to share methods for de/serializing objects.F)fullc               @    SSK Jn  [        R                  " U 4X1S.UD6$ )zReturn this object's data as a JSON string.

Parameters:
    full: Whether to return full info, or just base info.
    **kwargs: Additional serialization options passed to encoder.

Returns:
    A JSON string.
r   )JSONEncoder)clsrb   )griffe._internal.encodersrd   jsondumps)r*   rb   kwargsrd   s       r   as_jsonSerializationMixin.as_json   s      	:zz$EKEfEEr!   c                    SSK Jn  UR                  SU5        [        R                  " U40 UD6n[        X@5      (       d  [        SU  35      eU$ )aR  Create an instance of this class from a JSON string.

Parameters:
    json_string: JSON to decode into Object.
    **kwargs: Additional options passed to decoder.

Returns:
    An Object instance.

Raises:
    TypeError: When the json_string does not represent and object
        of the class from which this classmethod has been called.
r   )json_decoderobject_hookz$provided JSON object is not of type )rf   rm   
setdefaultrg   loadsr   	TypeError)re   json_stringri   rm   objs        r   	from_jsonSerializationMixin.from_json   sM     	;-6jj//###B3%HII
r!   r1   N)rb   boolri   r   r3   r   )re   ztype[_ObjType]rr   r   ri   r   r3   r   )	r4   r5   r6   r7   r8   rj   classmethodrt   r9   r1   r!   r   r`   r`      s"    B&+ F  r!   r`   c                  D   \ rS rSrSr\SS j5       r\SS j5       r\SS j5       r\SS j5       r	\SS j5       r
\SS j5       r\SS	 j5       r\SS
 j5       r\SS j5       r\SS j5       r\SS j5       r\SS j5       r\SS j5       r\SS j5       r\SS j5       rSrg)ObjectAliasMixin   zPMixin class to share methods that appear both in objects and aliases, unchanged.c                p    U R                   (       a  0 U R                  EU R                  E$ U R                  $ )zxAll members (declared and inherited).

This method is part of the consumer API:
do not use when producing Griffe trees!
)is_classr?   r.   r*   s    r   r(   ObjectAliasMixin.all_members   s/     ===d,,===||r!   c                    U R                   R                  5        VVs0 s H&  u  pUR                  [        R                  L d  M$  X_M(     snn$ s  snnf )zfThe module members.

This method is part of the consumer API:
do not use when producing Griffe trees!
)r(   itemskindr   MODULEr*   rA   r\   s      r   modulesObjectAliasMixin.modules  sE     261A1A1G1G1Ih1IV[[\`\g\gMg1Ihhh   #AAc                    U R                   R                  5        VVs0 s H&  u  pUR                  [        R                  L d  M$  X_M(     snn$ s  snnf )zeThe class members.

This method is part of the consumer API:
do not use when producing Griffe trees!
)r(   r   r   r   CLASSr   s      r   classesObjectAliasMixin.classes  sE     261A1A1G1G1Ig1IV[[\`\f\fMf1Igggr   c                    U R                   R                  5        VVs0 s H&  u  pUR                  [        R                  L d  M$  X_M(     snn$ s  snnf )zhThe function members.

This method is part of the consumer API:
do not use when producing Griffe trees!
)r(   r   r   r   FUNCTIONr   s      r   	functionsObjectAliasMixin.functions  sE     261A1A1G1G1Ij1IV[[\`\i\iMi1Ijjjr   c                    U R                   R                  5        VVs0 s H&  u  pUR                  [        R                  L d  M$  X_M(     snn$ s  snnf )ziThe attribute members.

This method is part of the consumer API:
do not use when producing Griffe trees!
)r(   r   r   r   	ATTRIBUTEr   s      r   
attributesObjectAliasMixin.attributes&  sE     261A1A1G1G1Ik1IV[[\`\j\jMj1Ikkkr   c                    U R                   R                  5        VVs0 s H&  u  pUR                  [        R                  L d  M$  X_M(     snn$ s  snnf )zjThe type alias members.

This method is part of the consumer API:
do not use when producing Griffe trees!
)r(   r   r   r   
TYPE_ALIASr   s      r   type_aliasesObjectAliasMixin.type_aliases/  sE     261A1A1G1G1Il1IV[[\`\k\kMk1Illlr   c                h    U R                   R                  S5      =(       a    U R                  (       + $ )zGWhether this object/alias is private (starts with `_`) but not special._)rA   
startswith
is_specialr}   s    r   
is_privateObjectAliasMixin.is_private8  s%     yy##C(@-@@r!   c                |    U R                   R                  S5      =(       a    U R                   R                  S5      $ )z[Whether this object/alias is special ("dunder" attribute/method, starts and end with `__`).__)rA   r   endswithr}   s    r   r   ObjectAliasMixin.is_special=  s-     yy##D)Fdii.@.@.FFr!   c                    [        U R                  5      =(       a_    U R                  R                  =(       aB    U R                  R	                  S5      =(       a     U R                  R                  S5      (       + $ )zTWhether this object/alias is class-private (starts with `__` and is a class member).r   )rv   rN   r|   rA   r   r   r}   s    r   is_class_private!ObjectAliasMixin.is_class_privateB  sT     v$++"6"6v499;O;OPT;Uv^b^g^g^p^pqu^vZv	
r!   c                    [        U R                  5      =(       a#    U R                  U R                  R                  ;   $ )z;Whether this object/alias was imported from another module.)rv   rN   rA   importsr}   s    r   is_importedObjectAliasMixin.is_importedI  s+     DKK ETYY$++2E2E%EEr!   c                   [        U R                  5      =(       af    U R                  R                  =(       aI    [        U R                  R                  =(       a#    U R                  U R                  R                  ;   5      $ )z<Whether this object/alias is exported (listed in `__all__`).)rv   rN   rT   exportsrA   r}   s    r   is_exportedObjectAliasMixin.is_exportedN  sX      O%%OT[[((MTYY$++:M:M-MN	
r!   c                   U R                   (       a5  [        U R                  5      (       a  U R                  R                  (       d  gU R                  R                  b#  U R
                  U R                  R                  ;   $ U R
                  R                  S5      (       a  gU R                  =(       d$    U R                  (       + =(       d    U R                  $ )a  Whether this object/alias is exposed to wildcard imports.

To be exposed to wildcard imports, an object/alias must:

- be available at runtime
- have a module as parent
- be listed in `__all__` if `__all__` is defined
- or not be private (having a name starting with an underscore)

Special case for Griffe trees: a submodule is only exposed if its parent imports it.

Returns:
    True or False.
Fr   )	runtimerv   rN   rT   r   rA   r   rS   r   r}   s    r   is_wildcard_exposed$ObjectAliasMixin.is_wildcard_exposedW  s    " ||D$5$5$++:O:O ;;*99 3 333 99$$ }}FDNN 2Fd6F6FFr!   c                   U R                   b  U R                   $ U R                  (       d2  U R                  (       a!  U R                  R	                  S5      (       d  gU R
                  (       ab  U R
                  R                  (       aG  [        U R
                  R                  5      (       a#  U R                  U R
                  R                  ;   $ U R                  (       a  gU R                  (       a  gg)a  Whether this object is considered public.

In modules, developers can mark objects as public thanks to the `__all__` variable.
In classes however, there is no convention or standard to do so.

Therefore, to decide whether an object is public, we follow this algorithm:

- If the object's `public` attribute is set (boolean), return its value.
- If the object is listed in its parent's (a module) `__all__` attribute, it is public.
- If the parent (module) defines `__all__` and the object is not listed in, it is private.
- If the object has a private name, it is private.
- If the object was imported from another module, it is private.
- Otherwise, the object is public.
r   TF)
publicrS   rT   rA   r   rN   rv   r   r   r   r}   s    r   	is_publicObjectAliasMixin.is_publicw  s    " ;;";; }}		8L8LS8Q8Q ;;4;;00T$++:M:M5N5N99 3 333
 ??
  r!   c                ,    [        U R                  5      $ )z"Whether this object is deprecated.)rv   
deprecatedr}   s    r   is_deprecatedObjectAliasMixin.is_deprecated  s     DOO$$r!   c                ,    [        U R                  5      $ )zWhether this object is generic.)rv   type_parametersr}   s    r   
is_genericObjectAliasMixin.is_generic  s     D(())r!   r1   N)r3   zdict[str, Object | Alias])r3   zdict[str, Module])r3   zdict[str, Class])r3   zdict[str, Function])r3   zdict[str, Attribute])r3   zdict[str, TypeAlias])r3   rv   )r4   r5   r6   r7   r8   propertyr(   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r1   r!   r   ry   ry      sB   Z  i i h h k k l l m m A A G G 
 
 F F 
 
 G G> * *X % %
 * *r!   ry   )r   r2   r3   zSequence[str])"
__future__r   rg   
contextlibr   typingr   r   r   griffe._internal.enumerationsr   griffe._internal.exceptionsr	   r
   r   griffe._internal.mergerr   collections.abcr   griffe._internal.modelsr   r   r   r   r   r   r   r   r    r#   r;   rI   r`   ry   r1   r!   r   <module>r      s    #   . . . b b /(ddd:	-< -<d49 49nF@ F@R& &Rp*J\ p*r!   