
    gmn                     ~   d Z ddlZddlZddlZddlZddlmZ dej                  dd cxk  rdk  r
n nddlmZ	 n(ej                  dd dk\  r	 ddlmZ	 nddlmZ  ee      Z	ej                  dd dk\  ZerddlZd	Zd	Zd	Zd	Zd
ZerJddlmZmZmZmZmZmZmZmZmZ ddlmZmZ ej                  dd dk\  rddlm Z  ee ejB                  fZ"n6efZ"n2ddlmZm#Z#mZmZm$Z$mZm%Z%m&Z& 	 ddlm'Z'm(Z( 	 ddlm)Z) 	 ddlmZ 	 ddlmZ d Z*d Z+d Z,d Z-d Z.d Z/	 ej`                  Z1d Z3ehZ4 e5ed      re4jm                  ej>                         d Z7d Z8d Z9d Z:d  Z;d! Z<d" Z=d# Z>d$ Z?d% Z@d8d&ZAd' ZBd( ZCd) ZDd* ZEd+ ZFd, ZGd- ZHd. ZId9d/ZJd9d0ZKd9d1ZLd9d2ZMd3 ZNd4 ZOd5 ZPd6 ZQd7 ZRy# e
$ r
 ddlmZ	 Y Qw xY w# e
$ r  ee      Z'd
Zd	ZY w xY w# e
$ r 	 ddlm)Z) n# e
$ r d
ZY nw xY wY w xY w# e
$ r 	 ddlmZ n# e
$ r d
ZY nw xY wY w xY w# e
$ r 	 ddlmZ n# e
$ r d
ZY nw xY wY *w xY w# e2$ r dZ1Y w xY w):zDefines experimental API for runtime inspection of types defined
in the standard "typing" module.

Example usage::
    from typing_inspect import is_generic_type
    N)_TypedDictMeta)      r   r   )r   	      )	TypedDict)r      r   TF)	GenericCallableUnionTypeVarClassVarTuple_GenericAlias
ForwardRefNewType)FinalLiteral)r   r   r   )_SpecialGenericAlias)r   CallableMetar   r   	TupleMetar   GenericMeta_ForwardRef)_Union	_ClassVar)_Final)r   )r   c                     t        | t              sJ t        | d      r| j                  S | j                  | j                  } | j                  | S )z@This function exists for compatibility with old typing versions._gorg)
isinstancer   hasattrr   
__origin__clss    C/var/www/openai/venv/lib/python3.12/site-packages/typing_inspect.pyr   r   \   sJ    c;'''sGyy
..
$nn ..
$J    c                 8   t         rlt        | t              xr t        | t              xsH t        | t
              xr6 | j                  t        t        t        t        j                  j                  fvS t        | t              xr t        | t        t        f       S )a  Test if the given type is a generic type. This includes Generic itself, but
    excludes special typing constructs such as Union, Tuple, Callable, ClassVar.
    Examples::

        is_generic_type(int) == False
        is_generic_type(Union[int, str]) == False
        is_generic_type(Union[int, T]) == False
        is_generic_type(ClassVar[List[int]]) == False
        is_generic_type(Callable[..., T]) == False

        is_generic_type(Generic) == True
        is_generic_type(Generic[T]) == True
        is_generic_type(Iterable[int]) == True
        is_generic_type(Mapping) == True
        is_generic_type(MutableMapping[T, List[int]]) == True
        is_generic_type(Sequence[Union[str, bytes]]) == True
    )
NEW_TYPINGr   type
issubclassr
   typingGenericAliasr!   r   tupler   collectionsabcr   r   r   r   tps    r$   is_generic_typer0   f   s    $ 2t$@B)@ X212 XeUHkoo>V>V%WW	Y r;' 6rL)45-6 7r%   c                 H   t         r| t        u xs t        | t              xr& | j                  t
        j                  j                  u xsH t        | t              xr6 t        | t              xr$ t        | t
        j                  j                        S t        |       t        u S )a  Test if the type is a generic callable type, including subclasses
    excluding non-generic types and callables.
    Examples::

        is_callable_type(int) == False
        is_callable_type(type) == False
        is_callable_type(Callable) == True
        is_callable_type(Callable[..., int]) == True
        is_callable_type(Callable[[int, int], Iterable[str]]) == True
        class MyClass(Callable[[int], int]):
            ...
        is_callable_type(MyClass) == True

    For more general tests use callable(), for more precise test
    (excluding subclasses) use::

        get_origin(tp) is collections.abc.Callable  # Callable prior to Python 3.7
    )r'   r   r   r*   r!   r,   r-   r(   r)   r
   r   r.   s    r$   is_callable_typer2      s    & h 9*R1C"D #:!9!9992t$ 9B)@ 92{778	: 8|##r%   c                     t         rd| t        u xsZ t        | t              xr | j                  t
        u xs4 t        | t              xr" t        | t              xr t        | t
              S t        |       t        u S )a   Test if the type is a generic tuple type, including subclasses excluding
    non-generic classes.
    Examples::

        is_tuple_type(int) == False
        is_tuple_type(tuple) == False
        is_tuple_type(Tuple) == True
        is_tuple_type(Tuple[str, int]) == True
        class MyClass(Tuple[str, int]):
            ...
        is_tuple_type(MyClass) == True

    For more general tests use issubclass(..., tuple), for more precise test
    (excluding subclasses) use::

        get_origin(tp) is tuple  # Tuple prior to Python 3.7
    )
r'   r   r   r*   r!   r+   r(   r)   r
   r   r.   s    r$   is_tuple_typer4      sp    $ e &z".@A  '&&2t$ &B)@ &2u%	' 8y  r%   c                 p    | t        d      u ryt        |       rt        d t        | d      D              S y)a  Test if the type is type(None), or is a direct union with it, such as Optional[T].

    NOTE: this method inspects nested `Union` arguments but not `TypeVar` definition
    bounds and constraints. So it will return `False` if
     - `tp` is a `TypeVar` bound, or constrained to, an optional type
     - `tp` is a `Union` to a `TypeVar` bound or constrained to an optional type,
     - `tp` refers to a *nested* `Union` containing an optional type or one of the above.

    Users wishing to check for optionality in types relying on type variables might wish
    to use this method in combination with `get_constraints` and `get_bound`
    NTc              3   2   K   | ]  }t        |        y wN)is_optional_type).0tts     r$   	<genexpr>z#is_optional_type.<locals>.<genexpr>   s     N2MB#B'2Ms   )evaluateF)r(   is_union_typeanyget_argsr.   s    r$   r8   r8      s6     
T$Z	r	N(22MNNNr%   c                     t         r.| t        u xs$ t        | t              xr | j                  t        u S t
        xr t        |       t        u S )zTest if the type is a final type. Examples::

        is_final_type(int) == False
        is_final_type(Final) == True
        is_final_type(Final[int]) == True
    )r'   r   r   r*   r!   
WITH_FINALr(   r   r.   s    r$   is_final_typerB      sG     e N212Mr}}7M	O,$r(f,,r%   c                     t         rH| t        u xs> t        | t              xr | j                  t        u xs t
        xr t        | t
              S t        |       t        u S )a)  Test if the type is a union type. Examples::

        is_union_type(int) == False
        is_union_type(Union) == True
        is_union_type(Union[int, int]) == False
        is_union_type(Union[T, int]) == True
        is_union_type(int | int) == False
        is_union_type(T | int) == True
    )r'   r   r   r*   r!   MaybeUnionTyper(   r   r.   s    r$   r=   r=      sY     e DB 23N8NDBJr>$B	E 8vr%   r   c                     t         r.| t        v xs$ t        | t              xr | j                  t        v S t
        xr t        |       t        t              u S r7   )r'   LITERALSr   r*   r!   WITH_LITERALr(   r   r.   s    r$   is_literal_typerH      sI    h Q212Pr}}7P	R5DHW55r%   c                 $    t        |       t        u S )zTest if the type represents a type variable. Examples::

        is_typevar(int) == False
        is_typevar(T) == True
        is_typevar(Union[T, int]) == False
    )r(   r   r.   s    r$   
is_typevarrJ      s     8wr%   c                     t         r.| t        u xs$ t        | t              xr | j                  t        u S t
        rt        |       t        u S y)zTest if the type represents a class variable. Examples::

        is_classvar(int) == False
        is_classvar(ClassVar) == True
        is_classvar(ClassVar[int]) == True
        is_classvar(ClassVar[List[T]]) == True
    F)r'   r   r   r*   r!   WITH_CLASSVARr(   r   r.   s    r$   is_classvarrM     sH     h Q212Pr}}7P	R	Bx9$$r%   c                 Z   t         syt        j                  dd dk\  rWt        j                  j                  dk7  r:| t        t
        j                  fv xs  t        | t        t
        j                  f      S t        j                  dd dk\  rj	 t        | t
        j                        }|r|S | t        t
        j                  fv xs1 t        | dd      duxr  t        | dd	      d
k(  xr | j                  dv S | t        u xs t        | dd      duxr | j                  dv S # t        $ r Y w xY w)zTests if the type represents a distinct type. Examples::

        is_new_type(int) == False
        is_new_type(NewType) == True
        is_new_type(NewType('Age', int)) == True
        is_new_type(NewType('Scores', List[Dict[str, float]])) == True
    FNr   )r   
   r   beta)r   r   r   __supertype____qualname__ zNewType.<locals>.new_type)typingtyping_extensions)
WITH_NEWTYPEsysversion_inforeleaselevelr   rU   r   	TypeErrorgetattr
__module__)r/   ress     r$   is_new_typer^     sI    			"1		+0@0@0M0MQW0Ww 1 9 9:: E2):)B)BCD	F			"1		*	R!2!:!:;C 
w 1 9 9:: C_d34? B^R04OOB"AA	D g C_d34? B"AA	D  		s   D 	D*)D*c                 N    t         st        | t              S t        | t              S )zTests if the type is a :class:`typing.ForwardRef`. Examples::

        u = Union["Milk", Way]
        args = get_args(u)
        is_forward_ref(args[0]) == True
        is_forward_ref(args[1]) == False
    )r'   r   r   r   r.   s    r$   is_forward_refr`   6  s!     "k**b*%%r%   c                 h    t         rt        d      t               }t        | d|      }||u ry|| S |S )a  Get the last base of (multiply) subscripted type. Supports generic types,
    Union, Callable, and Tuple. Returns None for unsupported types.
    Examples::

        get_last_origin(int) == None
        get_last_origin(ClassVar[int]) == None
        get_last_origin(Generic[T]) == Generic
        get_last_origin(Union[T, int][str]) == Union[T, int]
        get_last_origin(List[Tuple[T, T]][int]) == List[Tuple[T, T]]
        get_last_origin(List) == List
    zEThis function is only supported in Python 3.6, use get_origin insteadr!   N)r'   
ValueErrorobjectr[   )r/   sentinelorigins      r$   get_last_originrf   C  sH      3 4 	4xHRx0F~	Mr%   c                 V   t         r?t        | t              r | j                  t        ur| j                  S dS | t
        u rt
        S yt        | t              rt        |       S t        |       rt        S t        |       rt        S t        |       rt         r| j                  xs | S t        S y)a  Get the unsubscripted version of a type. Supports generic types, Union,
    Callable, and Tuple. Returns None for unsupported types. Examples::

        get_origin(int) == None
        get_origin(ClassVar[int]) == None
        get_origin(Generic) == Generic
        get_origin(Generic[T]) == Generic
        get_origin(Union[T, int]) == Union
        get_origin(List[Tuple[T, T]][int]) == list  # List prior to Python 3.7
    N)r'   r   r*   r!   r   r
   r   r   r=   r   r4   r   rH   r   r.   s    r$   
get_originrh   [  s     b,-$&MM$A2==KtK=N"k"RyRRr==&B&r%   c                    t         rt        |       r:g }| j                  | j                  ndD ]  }|t        |      z  } t	        |      S t        |       r:g }| j                  | j                  ndD ]  }|t        |      z  } t	        |      S t        |       rg }| j                  }|y|D ]c  }t        |      rt        |      n|fD ]E  }t        |      rt        |t              st        d|z        |g }||vs5|j                  |       G e |t	        |      S yyt        rQt        | t               rt#        | d      s(t        | t$              r$t'        | t(              r| t(        ur| j                  S yt        |       s!t        |       st+        |       st        |       r| j                  | j                  S dS y)a>  Return type parameters of a parameterizable type as a tuple
    in lexicographic order. Parameterizable types are generic types,
    unions, tuple types and callable types. Examples::

        get_parameters(int) == ()
        get_parameters(Generic) == ()
        get_parameters(Union) == ()
        get_parameters(List[int]) == ()

        get_parameters(Generic[T]) == (T,)
        get_parameters(Tuple[List[T], List[S_co]]) == (T, S_co)
        get_parameters(Union[S_co, Tuple[T, T]][int, U]) == (U,)
        get_parameters(Mapping[T, Tuple[S_co, T]]) == (T, S_co)
     zKCannot inherit from a generic class parameterized with non-type-variable %s__parameters__)LEGACY_TYPINGr=   __union_params__get_parametersr+   r4   __tuple_params__r0   rk   r?   _has_type_varr   r   rZ   appendr'   r*   r    r(   r)   r
   r2   )r/   paramsargbase_paramsbp_bps         r$   rn   rn   z  s    F/1/B/B/N++TVV.-- W= 2F/1/B/B/N++TVV.-- W= R F++K"",9#,>8C=SFJB$R(B1H'35789 9 ~!#'b) K # !V}$	 r#56B 012t$B)@'!$$$}R0b 1$&$5$5$Ar  IrIr%   c                    t         rt        d      t        |       r| j                  | j                  fS dS t	        |       rK	 | j
                  $t        | j
                        dkD  r| j
                  S | j                  | j                  S dS t        |       r	 | j
                  | j
                  S dS t        |       r| j
                  | j
                  S dS t        |       r	 | j
                  | j
                  S dS y# t        $ r Y w xY w# t        $ r | j                  | j                  cY S dcY S w xY w# t        $ r | j                  | j                  cY S dcY S w xY w)a  Get last arguments of (multiply) subscripted type.
       Parameters for Callable are flattened. Examples::

        get_last_args(int) == ()
        get_last_args(Union) == ()
        get_last_args(ClassVar[int]) == (int,)
        get_last_args(Union[T, int]) == (T, int)
        get_last_args(Iterable[Tuple[T, S]][int, T]) == (int, T)
        get_last_args(Callable[[T], int]) == (T, int)
        get_last_args(Callable[[], int]) == (int,)
    zCThis function is only supported in Python 3.6, use get_args insteadrj   r   )r'   rb   rM   __type__r0   __args__lenAttributeErrorrk   r=   rm   r2   r4   ro   r.   s    r$   get_last_argsr|     sl     1 2 	2	R!#!8~@b@			{{&3r{{+;a+?{{" %'$5$5$Ar  IrI	r		R"$++"92;;ArA 
"	 kk5r{{=2=	r		R"$++"92;;ArA
 '  		  	R*,*=*=*I2&&QrQ	R  	R*,*=*=*I2&&QrQ	RsN   /D  D 2D %D: =D:  	DD!D72D76D7:!E"E"!E"c                    g }| D ]  }t        |t              s|j                  |       %t        |d         rt	        |dd       }t        |      dk(  r|j                  t        g |d   f          m|d   t        u r|j                  t        d|d   f          |j                  t        t        |dd       |d   f          |j                  t        |d         j                  |d   t	        |dd                     t        |      S )zInternal helper for get_args.r      Nr   .)r   r+   rq   r2   
_eval_argsrz   r   Ellipsislistr(   __getitem__)argsr]   rs   callable_argss       r$   r   r     s    
C#u%JJsOc!f%&s12w/M3x1}

8Ba(8$89:Q8#

8Cq)9$9:;

8Ds);$<mB>O$OPQJJtCF|//A
3qr78KLM  :r%   c                    t         r||st        d      t        | t              r]t	        | d      rQ| j
                  }t        |       t        j                  j                  u r|d   t        urt        |dd       |d   f}|S t        rt        | t              r| j
                  S yt        |       st        |       r| j                  | j                  fS dS t!        |       r| j"                  xs dS t%        |       s!t'        |       st)        |       st+        |       ru	 | j-                         }t        |t6              rTt9        |      dkD  rF|s|dd S t;        |dd       }t        |       t        u r|d   t        urt        |dd       |d   f}|S y# t.        $ rJ t'        |       rt1        |       }n0t%        |       rt3        |       }nt+        |       rt5        |       }nY yY w xY w)a  Get type arguments with all substitutions performed. For unions,
    basic simplifications used by Union constructor are performed.
    On versions prior to 3.7 if `evaluate` is False (default),
    report result as nested tuple, this matches
    the internal representation of types. If `evaluate` is True
    (or if Python version is 3.7 or greater), then all
    type parameters are applied (this could be time and memory expensive).
    Examples::

        get_args(int) == ()
        get_args(Union[int, Union[T, int], str][int]) == (int, str)
        get_args(Union[int, Tuple[T, int]][str]) == (int, (Tuple, str, int))

        get_args(Union[int, Tuple[T, int]][str], evaluate=True) ==                  (int, Tuple[str, int])
        get_args(Dict[int, Tuple[T, T]][Optional[int]], evaluate=True) ==                  (int, Tuple[Optional[int], Optional[int]])
        get_args(Callable[[], T][int], evaluate=True) == ([], int,)
    Nz*evaluate can only be True in Python >= 3.7ry   r   r   rj   r~   )r'   rb   r   r*   r    ry   rh   r,   r-   r   r   r   rD   rM   rB   rx   rH   
__values__r0   r=   r2   r4   
_subs_treer{   _union_subs_tree_generic_subs_tree_tuple_subs_treer+   rz   r   )r/   r<   r]   trees       r$   r?   r?     s   ( IJJb,-'"j2I++C"~!9!99c!fH>TCH~s2w/Jj^<;;2-+!#!8~@b@r}}""}R0b 1	==?D  dE"s4y1}ABxT!"X&C"~)c!fH.DCH~s2w/J/  	R '+ $)"-r"'+ 	s   F AG'&G'c                 `    t        |       rt        | dd      S t        dt        |       z         )zReturn the type bound to a `TypeVar` if any.

    It the type is not a `TypeVar`, a `TypeError` is raised.
    Examples::

        get_bound(TypeVar('T')) == None
        get_bound(TypeVar('T', bound=int)) == int
    	__bound__Ntype is not a `TypeVar`: rJ   r[   rZ   strr.   s    r$   	get_boundr   A  s/     "~r;--3c"g=>>r%   c                 `    t        |       rt        | dd      S t        dt        |       z         )zReturns the constraints of a `TypeVar` if any.

    It the type is not a `TypeVar`, a `TypeError` is raised
    Examples::

        get_constraints(TypeVar('T')) == ()
        get_constraints(TypeVar('T', int, str)) == (int, str)
    __constraints__rj   r   r   r.   s    r$   get_constraintsr   Q  s0     "~r,b113c"g=>>r%   c                 :    t        | dd      }||S t        |       S )a6  Get the generic type of an object if possible, or runtime class otherwise.
    Examples::

        class Node(Generic[T]):
            ...
        type(Node[int]()) == Node
        get_generic_type(Node[int]()) == Node[int]
        get_generic_type(Node[T]()) == Node[T]
        get_generic_type(1) == int
    __orig_class__N)r[   r(   )objgen_types     r$   get_generic_typer   a  s'     s,d3H+8:c:r%   c                 `    t         rt        d | j                  D              S t        | dd      S )a  Get generic base types of a type or empty tuple if not possible.
    Example::

        class MyClass(List[int], Mapping[str, List[int]]):
            ...
        MyClass.__bases__ == (List, Mapping)
        get_generic_bases(MyClass) == (List[int], Mapping[str, List[int]])
    c              3   B   K   | ]  }t        |t              s|  y wr7   )r   r   )r9   ts     r$   r;   z$get_generic_bases.<locals>.<genexpr>{  s     K1
1k0JQs   __orig_bases__rj   )rl   r+   	__bases__r[   r.   s    r$   get_generic_basesr   q  s,     KKKKr+R00r%   c                 d    t        | t        t        f      r| j                  j	                         S y)a  If td is a TypedDict class, return a dictionary mapping the typed keys to types.
    Otherwise, return None. Examples::

        class TD(TypedDict):
            x: int
            y: int
        class Other(dict):
            x: int
            y: int

        typed_dict_keys(TD) == {'x': int, 'y': int}
        typed_dict_keys(dict) == None
        typed_dict_keys(Other) == None
    N)r   _TypedDictMeta_Mypy_TypedDictMeta_TE__annotations__copy)tds    r$   typed_dict_keysr     s-     "*,=>?!!&&((r%   c                 4    t        |       r| j                  S dS )a  
    If fr is a ForwardRef, return the string representation of the forward reference.
    Otherwise return None. Examples::

        tp = List["FRef"]
        fr = get_args(tp)[0]
        get_forward_arg(fr) == "FRef"
        get_forward_arg(tp) == None
    N)r`   __forward_arg__)frs    r$   get_forward_argr     s     "0!32==r%   c                     |g }t        |       rt        | ||      S t        |       rt        | ||      S t	        |       rt        | ||      S t        | t              rt        |      D ]  \  }}| |k(  s||   c S  | S )zbackport of _replace_arg)	r=   r   r4   r   r0   r   r   r   	enumerate)rs   tvarsr   itvars        r$   _replace_argr     s    } SUD11SUD11s!#ud33#w 'GAtd{Aw ( Jr%   c                    g }| D ]}  }t        |t              r|j                  |j                         /t        |t              r.t        |      dkD  r |d   t        u r|j                  |dd        m|j                  |        t        |      t              t        |      k  r;g }|D ])  }|v s|j                  |       j                  |       + |}rJ        t        |      |D ]=  t        t              st        fdhz
  D              s-j                         ? t	        fd|D              S )z backport of _remove_dups_flattenr   r~   Nc              3      K   | ]M  }t        |t              rt        |      0t        |t              s t        |t              xr t        |       O y wr7   )r   r   rh   r   r(   r)   )r9   t2t1s     r$   r;   z'_remove_dups_flatten.<locals>.<genexpr>  sM      1*2"2{3"22!"g.	 "d#:
2r(::*s   AAc              3   ,   K   | ]  }|v s|  y wr7   rj   )r9   r   
all_paramss     r$   r;   z'_remove_dups_flatten.<locals>.<genexpr>  s     6Fqa:oFs   	)r   r   extendrm   r+   rz   r   rq   setremover(   r>   )
parametersrr   p
new_paramsr   r   r   s        @@r$   _remove_dups_flattenr     s.    Fa MM!,,-5!c!fqjQqTU]MM!AB% MM!  VJ
:V$
AJ!!!$!!!$  )z)~ VJ"d# 1#rd*1 1
 b!  6F666r%   c           
      ~   d } ||       }|t        |       st        |       s| S g } ||      "|j                  |        ||      } ||      "g }d } ||       D ]  }|j                  t        |||               |D ]8  }	g }
 ||	      D ]'  }|
j                  t        |t	        |	      |             ) |
}: |S )z;backport of typing._subs_tree, adapted for legacy versions c                 :    	 | j                   S # t        $ r Y y w xY wr7   )r!   r{   r"   s    r$   _get_originz_subs_tree.<locals>._get_origin  s#    	>>! 		s    	c                     t        |       r| j                  }n%t        |       r| j                  }n	 | j                  }||S dS # t
        $ r d}Y w xY w)Nrj   )r=   rm   r4   ro   ry   r{   )r#   cls_argss     r$   	_get_argsz_subs_tree.<locals>._get_args  s^    ++H3++H<< $/x7R7 " s   A AA)r=   r4   rq   r   rn   )r#   r   r   r   current
orig_chain	tree_argsr   rs   oclsnew_tree_argss              r$   r   r     s     #GS!-*<J J
g

*'"g& g

*
 I
8 ~c5$78  T?C  c>$3G!ST #!		 
 r%   c                     | t         u rt         S t        | ||      }t        |      }t        |      dk(  r|d   S t         f|z   S )z backport of Union._subs_tree r~   r   )r   r   r   rz   r/   r   r   r   s       r$   r   r     sI    	U{2ud+I$Y/I
9~|8ir%   c                 h    | j                   | S t        | ||      }t        |       ft        |      z   S )z$ backport of GenericMeta._subs_tree )r!   r   r   r+   r   s       r$   r   r     s5    	}}	2ud+I"I<%	***r%   c                 ^    | t         u rt         S t        | ||      }t         ft        |      z   S )z7 ad-hoc function (inspired by union) for legacy typing )r   r   r+   r   s       r$   r   r     s.    	U{2ud+I8eI&&&r%   c                     | yt        |       rt        |       S t        |       rt        |       S t	        |       rt        |       S t        |       rt        |       S y)NF)r=   _union_has_type_varr4   _tuple_has_type_varr0   _generic_has_type_varr2   _callable_has_type_var)r   s    r$   rp   rp   '  sY    y	q	"1%%	q	"1%%		$Q''	!	%a((r%   c                 X    | j                   r| j                   D ]  }t        |      s y yNTF)rm   rp   r/   r   s     r$   r   r   6  +    	$$AQ % r%   c                 X    | j                   r| j                   D ]  }t        |      s y yr   )ro   rp   r   s     r$   r   r   >  r   r%   c                     | j                   r| j                   D ]  }t        |      s y t        | j                        S )NT)ry   rp   
__result__r   s     r$   r   r   F  s3    	{{AQ  ''r%   c                 X    | j                   r| j                   D ]  }t        |      s y yr   )rk   rp   r   s     r$   r   r   N  s+    	""AQ # r%   r7   )NN)S__doc__rW   typesrT   rU   mypy_extensionsr   r   rX   r   ImportErrorr   r(   r'   collections.abcr,   rA   rG   rL   rV   rl   r
   r   r   r   r   r   r   r   r   r   r   r   GenericAliasr*   r   r   r   r   r   r   r   r   r0   r2   r4   r8   rB   	UnionTyperD   r{   r=   rF   r    addrH   rJ   rM   r^   r`   rf   rh   rn   r|   r   r?   r   r   r   r   r   r   r   r   r   r   r   r   rp   r   r   r   r   rj   r%   r$   <module>r      s       A   !$0y0EbqY&?I
 !Ybq!Y.

   1
y(/+-A5CUCUV+-  ,,!-!-74$6!4*
-__N
" 9
69LL 6"D@
&0>BJ(V&AH? ? ; 1(
>&%7P*Z	 +'(i  ?>>?F  e	  	% 	J	  !	!& 	! L	!!  !	!& 	! L	!!H  Ns   F& &F8 /G 6G/ =H H1 &F54F58GGG,GG,G&#G,%G&&G,+G,/H5G<;H<HHHHHH.HH.H'$H.&H''H.-H.1H<;H<