o
    2gF                    @  s  U d Z ddlmZ ddlZddlZddlZddlZddlZddl	Z	ddl
Z	ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZ ddlmZmZ ddlmZ ddlmZ ddlmZmZmZm Z m!Z!m"Z" dd	lm#Z#m$Z$ ddl%Z&ddl'Z&ddl(Z&ddl)Z&ddl*Z&ddl+Z&dd
l&m,Z, ddl-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5m6Z6m7Z7m8Z8 G dd dZ9e9 Z:de;d< e!dZ<e"e<e9f Z=de;d< G dd dZ>e> Z?de;d< e5ej@ejAdZBde;d< dd d!ZCdd$d%ZDG d&d' d'eEZFG d(d) d)ZGdd,d-ZHdd/d0ZIedd7d8ZJdd<d=ZKejLdd?d@ZMeJNe,jOddBdCZPddFdGZQddJdKZReJNe,jSddMdNZTddOdPZUddTdUZVdd[d\ZWdd]d^ZXddbdcZYG ddde deee< ZZddhdiZ[ddkdlZ\eJNe,j]ddndoZ^eJNe9ddpdqZ_eJNe,j`ddsdtZaeJNe,jbddvdwZceJNe,jdddydzZeeJNe,jfdd|d}ZgdddZhdddZidddZjdddZkeJNe,jldddZmeJNe,jndddZoeph dZqde;d< eph dZrde;d< dddZsdddZtdddZudddZvdddZwdddZxdddZyi azde;d< ddddZ{dddZ|	ddddZ}dddZ~dddZG ddÄ dÃZeph dģZde;d< ddddȄZdddʄZddd̄Zedkrmee  dS dS )ziTests for stubs.

Verify that various things in stubs are consistent with how things behave at runtime.

    )annotationsN)defaultdict)redirect_stderrredirect_stdout)singledispatch)Path)AbstractSetAnyGenericIteratorTypeVarUnion)
get_originis_typeddict)nodes)parse_config_file)UNKNOWNevaluate_expression)Options)FancyFormatterbytes_to_human_readable_repr	is_dunderplural_sc                   @     e Zd ZdZdddZdS )MissingzGMarker object for things that are missing (from a stub or the runtime).returnstrc                 C     dS )NMISSING selfr   r   E/home/garg/my-data/venv/lib/python3.10/site-packages/mypy/stubtest.py__repr__2      zMissing.__repr__Nr   r   __name__
__module____qualname____doc__r#   r   r   r   r"   r   /       r   ztyping_extensions.Finalr   Tztyping_extensions.TypeAliasMaybeMissingc                   @  r   )Unrepresentablez5Marker object for unrepresentable parameter defaults.r   r   c                 C  r   )N<unrepresentable>r   r    r   r   r"   r#   ?   r$   zUnrepresentable.__repr__Nr%   r&   r   r   r   r"   r.   <   r+   r.   UNREPRESENTABLEF
_formattermessager   kwargsr	   r   c                 K  s   | dd tj| fi |S )z.Wrapper around mypy.util for fancy formatting.colornone)
setdefaultr1   style)r2   r3   r   r   r"   _styleI   s   r8   lengthintc                 C  s$   t | |kr| d |d  d S | S )N   ...)len)r2   r9   r   r   r"   	_truncateO   s   r>   c                   @     e Zd ZdS )StubtestFailureNr'   r(   r)   r   r   r   r"   r@   U       r@   c                   @  s>   e Zd ZddddddZdddZdddZddddZdS )ErrorN	stub_descruntime_descobject_path	list[str]r2   r   stub_objectMaybeMissing[nodes.Node]runtime_objectMaybeMissing[Any]rE   
str | NonerF   r   Nonec          
      C  s   || _ d|| _|| _|| _|| _|ptt|d|| _|du rFt	|}|du r3t
t|d| _dS t|}t||d}	t
|	d| _dS || _dS )a  Represents an error found by stubtest.

        :param object_path: Location of the object with the error,
            e.g. ``["module", "Class", "method"]``
        :param message: Error message
        :param stub_object: The mypy node representing the stub
        :param runtime_object: Actual object obtained from the runtime
        :param stub_desc: Specialised description for the stub object, should you wish
        :param runtime_desc: Specialised description for the runtime object, should you wish

        .typeNd   is_async)rG   joinobject_descr2   rI   rK   r   getattrrE   safe_inspect_signaturer>   reprrF   inspectiscoroutinefunctiondescribe_runtime_callable)
r!   rG   r2   rI   rK   rE   rF   runtime_sigruntime_is_asyncdescriptionr   r   r"   __init__Z   s   

zError.__init__boolc                 C  s   t | jtS )z@Whether or not the error is for something missing from the stub.)
isinstancerI   r   r    r   r   r"   is_missing_stub   s   zError.is_missing_stubc                 C  s
   d| j v S )zOWhether or not the error is for something being (or not being) positional-only.zleading double underscore)r2   r    r   r   r"   is_positional_only_related   s   
z Error.is_positional_only_relatedFconcisec           
      C  s  |rt | jddd | j S d}d}t| jts| jj}t| jd }|dur,|j	p+d}d}|r9|dt
| 7 }|rG||r@dnd	 | 7 }d}d}t| jtszz
t| jd
 }W n tttfyg   Y nw zt| j}W n	 tyy   Y nw d}|r|dt
| 7 }|r||rdnd	 | 7 }t ddddt | jddd| jddt |dddt | jd ddddt |dddt | jd dddg}	d|	S )zxReturns a description of the error.

        :param concise: Whether to return a concise, one-line description

        T)bold Nr    z	 in file :z	 at line    zerror: redr4   re   
zStub:)dimblue)r4   rm   zRuntime:)r8   rU   r2   ra   rI   r   lineget_stubrG   pathr   rK   rY   getsourcelinesOSError	TypeErrorSyntaxErrorgetsourcefilerE   rF   rT   )
r!   rd   	stub_line	stub_file	stub_nodestub_loc_strruntime_lineruntime_fileruntime_loc_stroutputr   r   r"   get_description   s^   



zError.get_description)rG   rH   r2   r   rI   rJ   rK   rL   rE   rM   rF   rM   r   rN   )r   r`   F)rd   r`   r   r   )r'   r(   r)   r_   rb   rc   r   r   r   r   r"   rC   Y   s    
'
rC   module_nametypes.ModuleTypec                 C  s   t tjd^}t A t|- t| td t	| }t
| dgd W d    n1 s1w   Y  W d    n1 s@w   Y  W d    n1 sOw   Y  W d    |S W d    |S 1 sgw   Y  |S )Nwignore*)fromlist)openosdevnullwarningscatch_warningsr   r   simplefilter	importlibimport_module
__import__)r   r   runtimer   r   r"   silent_import_module   s"   

  

r   Iterator[Error]c                 c  s   t | }|du r-t| dd s+| tjv rttj|  nd}t| gdtd|dV  dS zt| }W n8 t	y;     t
yk } z%d}t|trKd}t| gd	| d
t|j d| |tV  W Y d}~dS d}~ww t q td zt||| gE dH  W nN ty } zBtt|jd d }|jdd}|dks|dd dkr t| gdt|j d| ||ddt   dV  W Y d}~nd}~ww W d   dS W d   dS 1 sw   Y  dS )zTests a given module's stub against introspecting it at runtime.

    Requires the stub to have been built already, accomplished by a call to ``build_stubs``.

    :param module_name: The module to test

    NrO   N/Azfailed to find stubsrF   rg   z7 Maybe install the runtime package or alter PYTHONPATH?zfailed to import.rf   : r   r   r'   __main__mypyzencountered unexpected error, zThis is most likely the fault of something very dynamic in your library. It's also possible this is a bug in stubtest.
If in doubt, please open an issue at https://github.com/python/mypy

rD   )rp   is_probably_privatesplitsysmodulesrX   rC   r   r   KeyboardInterruptBaseExceptionra   ModuleNotFoundErrorrP   r'   r   r   r   verify	Exceptionlist	tracebackwalk_tb__traceback__	f_globalsget
format_excstrip)r   stubrF   r   enotebottom_framebottom_moduler   r   r"   test_module   s`   
"
	

"r   r   rJ   r   rL   rG   rH   c                 c  s    t |d| |V  dS )zEntry point for comparing a stub to a runtime object.

    We use single dispatch based on the type of ``stub``.

    :param stub: The mypy node representing a part of the stub
    :param runtime: The runtime object corresponding to ``stub``

    zis an unknown mypy nodeNrC   r   r   rG   r   r   r"   r     s   r   nodes.MypyFileruntime_all_as_setset[str]c                 c  st    d|j v sJ dd |j  D }t|| }t|| }|s$|s$d S t| dg dttd| d| dV  d S )N__all__c                 S  s   h | ]	\}}|j r|qS r   )module_public.0mor   r   r"   	<setcomp>"  s    z)_verify_exported_names.<locals>.<setcomp>znames exported from the stub do not correspond to the names exported at runtime. This is probably due to things being missing from the stub or an inaccurate `__all__` in the stubz/Names exported in the stub but not at runtime: z/Names exported at runtime but not in the stub: )rI   rK   rE   rF   )namesitemssortedrC   r   )rG   r   r   public_names_in_stubnames_in_stub_not_runtimenames_in_runtime_not_stubr   r   r"   _verify_exported_names  s   r   symtable.SymbolTable | Nonec              
   C  sR   zt | }W n tttfy   Y dS w z	t|| jdW S  ty(   Y dS w )zRetrieve the symbol table for the module (or None on failure).

    1) Use inspect to retrieve the source code of the module
    2) Use symtable to parse the source (and use what symtable knows for its purposes)
    Nexec)rY   	getsourcers   rt   ru   symtabler'   )r   sourcer   r   r"   _module_symbol_table:  s   r   MaybeMissing[types.ModuleType]c           	   	   #  sR   t trt|d| V  d S t tjs t|d| V  d S tdr9tj}d| jv r8t	|| |E d H  nd }fdd| j
 D }ddd |d urR|n fddtD }|| |t t|D ]:}|| jv ry| j| jnt}t |tjrql|d usJ zt|t}W n	 ty   Y qlw t||||g E d H  qld S )Nis not present at runtimezis not a moduler   c                   s,   h | ]\}}|j st|rt |r|qS r   )module_hiddenr   hasattrr   r   r   r"   r   c  s    z"verify_mypyfile.<locals>.<setcomp>rr   attrr   r   r`   c                 S  s   t | |}t|tjrdS t| }|dur2z||}W n	 ty%   Y nw | r,dS | r2dS z|j	}W n
 t
yA   Y dS w t|trNt|| jkS dS )zFHeuristics to determine whether a name originates from another module.FNT)rV   ra   types
ModuleTyper   lookupKeyErroris_importedis_assignedr(   r   r   r`   r'   )r   r   objsymbol_tablesymbolobj_modr   r   r"   _belongs_to_runtimei  s.   


z,verify_mypyfile.<locals>._belongs_to_runtimec                   s"   h | ]}t |s |r|qS r   )r   r   r   r   r   r   r"   r     s    )r   r   r   r   r   r`   )ra   r   rC   r   r   r   setr   r   r   r   dirupdatedifference_updateIGNORED_MODULE_DUNDERSr   noder   r   MypyFilerV   r   r   )	r   r   rG   r   to_checkruntime_public_contentsentry
stub_entryruntime_entryr   r   r"   verify_mypyfileL  sJ   





#

r   nodes.TypeInfo	type[Any]c              
   c  s    z
G dd d|}W n& t y)   | js't|tjs't|d| |t| dV  Y n	 ty1   Y nw zt|dd}W n tyE   d}Y nw |rY| js[t|d| |t| dV  d S d S d S )Nc                   @  r?   )z_verify_final.<locals>.SubClassNrA   r   r   r   r"   SubClass  rB   r   zIcannot be subclassed at runtime, but isn't marked with @final in the stubrE   	__final__FzChas `__final__` attribute, but isn't marked with @final in the stub)	rt   is_final
issubclassenumEnumrC   rX   r   rV   )r   r   rG   r   runtime_finalr   r   r"   _verify_final  s<   
r   is_runtime_typeddictr`   c                c  s    | j sF| jsH|sJt|}|tur$| jd u r$t|d| |d| dV  d S |tu rL| jd urNtj| jdsPt|d| || jjj ddV  d S d S d S d S d S d S d S )Nz"is inconsistent, metaclass differsr   rD   )zabc.ABCMetazbuiltins.typezmetaclass mismatch)	is_protocolis_enumrP   metaclass_typerC   r   r   is_named_instancefullname)r   r   rG   r   runtime_metaclassr   r   r"   _verify_metaclass  s:   	

r   MaybeMissing[type[Any]]c              	   #  s   | j rt|tst|d| |t| dV  d S t|tr*t|d| |t| dV  d S t|ts=t|d| |t| dV  d S t| ||E d H  | jd uoNt|}t	| |||dE d H  dd | j
D }|dd	 t|D  | jrv|d
 |r}|d t|D ]m  } dr dsd| jd   }t fdd	| jD t}|d usJ zzt||}W n ty   t||t}Y nw W n	 ty   Y qw t|trt|tjrt|ddst||| g E d H  qd S )N;is marked as "@type_check_only", but also exists at runtimer   r   zis not a type)r   c                 S  s   h | ]}|  r|qS r   )isidentifier)r   namer   r   r"   r         z"verify_typeinfo.<locals>.<setcomp>c                 s  s$    | ]}t |s|tvr|V  qd S N)r   IGNORABLE_CLASS_DUNDERSr   r   r   r"   	<genexpr>  s    z"verify_typeinfo.<locals>.<genexpr>r_   __new_____c                 3  s&    | ]} |j v r|j   jV  qd S r  )r   r   r   tr   r   r"   r  .  s   $ Texclude_special) is_type_check_onlyra   r   rC   rX   rP   r   typeddict_typer   r   r   r   varsr   discardr   
startswithendswithr   lstripnextmror   rV   AttributeErrorrY   getattr_staticr   r   WrapperDescriptorTyper   r   )r   r   rG   r   r   mangled_entrystub_to_verifyruntime_attrr   r
  r"   verify_typeinfo  sn   


	
	

	

r  c              	   C  sN   t | d }| dd  D ]}zt||}W q ty$   t Y   S w |S )Nr   ri   )r   r   rY   r  r  r   )rG   static_runtimer   r   r   r"   _static_lookup_runtimeE  s   r  nodes.FuncBaser  Iterator[str]c                 c  s    | j dv rd S t|r(tt|dd t}|r| jsdV  |s&| jr&dV  d S |tu r.d S t|tr9| js9dV  t|tsD| jrDdV  t|t	rO| j
sOdV  t|t	s\| j
r^dV  d S d S d S )N)r  __init_subclass____class_getitem____self__z(runtime is a classmethod but stub is notz(stub is a classmethod but runtime is notz)runtime is a staticmethod but stub is notz)stub is a staticmethod but runtime is not)r   rY   	isbuiltinra   rV   rP   is_classr   classmethodstaticmethod	is_static)r   r   r  rG   probably_class_methodr   r   r"   _verify_static_class_methodsR  s*   




r*  stub_argnodes.Argumentruntime_arginspect.Parameterfunction_namec                 c  s    t |ddr	dS ddd	}|| jjd
|jkrdS ddh}|j|v r%dS ddd}|jtjjkr;|| jj|jr;dS | jjdkrCdS d| jj d|j dV  dS )z$Checks whether argument names match.Tr  Nsr   prefixr   c                 S  s   |  |r| t|d  S | S r  )r  r=   )r0  r1  r   r   r"   strip_prefixw  s   z&_verify_arg_name.<locals>.strip_prefixr  objectargsabr`   c                 S  s@   |  d} | d}| |p|| pt| dkpt|dkS )Nr  ri   )r   r  r=   )r5  r6  r   r   r"   names_approx_match  s   

,z,_verify_arg_name.<locals>.names_approx_match_selfstub argument "z!" differs from runtime argument "")r0  r   r1  r   r   r   )r5  r   r6  r   r   r`   )r   variabler   kindrY   	ParameterPOSITIONAL_ONLY)r+  r-  r/  r2  nonspecific_namesr7  r   r   r"   _verify_arg_nameo  s(   



r@  c                 c  sH   |j tjjkr| j rd|j dV  dS t|j }| jj	p"| j
}t|tjjr-|j}|durS|durSt	|j turS|j durSt||sSd|j d| d| V  | jdurt| j}|tur|dur|j tur||j ksxt	|t	|j urd|j d|j d|V  dS dS dS dS dS dS | j rd	| jj d
V  dS dS )z6Checks whether argument default values are compatible.runtime argument "z0" has a default value but stub argument does notN.z" has a default value of type z0, which is incompatible with stub argument type z" has a default value of z0, which is different from stub argument default r9  z3" has a default value but runtime argument does not)defaultrY   r=  emptyr<  is_requiredr   get_mypy_type_of_runtime_valuer;  rP   type_annotationra   r   r   TypeVarTypeupper_boundr3  is_subtype_helperinitializerr   r   r0   is_optional)r+  r-  runtime_type	stub_typestub_defaultr   r   r"   _verify_arg_default_value  sV   









	rO  r   r4  list[nodes.Argument]c                 C  s,   |r| dv r|d j jdkr|dd  S |S )N)r!  r"  r   clsri   r;  r   )r   r4  r   r   r"   maybe_strip_cls  s   rS  c                   @  sJ   e Zd ZdddZdddZedddZedddZedddZdS )	Signaturer   rN   c                 C  s   g | _ i | _d | _d | _d S r  )poskwonlyvarposvarkwr    r   r   r"   r_     s   
zSignature.__init__r   c                   s   dddddd	ddddfdd t | j fddd}d}|d fdd| jD | jr?d| j gn| jrEdgng   fdd|D  | jr[d| j gng  7 }|d7 }|S )Nargr	   r   r   c                 S  s*   t | tjr	| jS t | tjr| jjS tr  )ra   rY   r=  r   r   Argumentr;  AssertionErrorrY  r   r   r"   get_name  s
   z#Signature.__str__.<locals>.get_namerM   c                 S  s2   t | tjrd S t | tjrt| jjp| jS t	r  )
ra   rY   r=  r   rZ  r   r;  rP   rF  r[  r\  r   r   r"   get_type  s
   z#Signature.__str__.<locals>.get_typer`   c                 S  s8   t | tjrt| jtjjkS t | tjr| j	 S t
r  )ra   rY   r=  r`   rB  rC  r   rZ  r<  rK  r[  r\  r   r   r"   has_default  s
   
z&Signature.__str__.<locals>.has_defaultc                   s4   | } | |rd| nd | rd S d S )Nr   rg   z = ...r   )rY  arg_type)r]  r^  r_  r   r"   get_desc  s   
z#Signature.__str__.<locals>.get_descc                   s   |  | fS r  r   )r5  )r]  r_  r   r"   <lambda>  s    z#Signature.__str__.<locals>.<lambda>keyzdef (z, c                      g | ]} |qS r   r   r   rY  ra  r   r"   
<listcomp>       z%Signature.__str__.<locals>.<listcomp>r   c                   re  r   r   rf  rg  r   r"   rh    ri  z**))rY  r	   r   r   )rY  r	   r   rM   )rY  r	   r   r`   )r   rV  valuesrT   rU  rW  rX  )r!   kw_onlyretr   )ra  r]  r^  r_  r"   __str__  s"   


$zSignature.__str__r   nodes.FuncItemSignature[nodes.Argument]c                 C  s~   t  }t| j| j}|D ]0}|j r|j| q|j r'||j	|j
j< q|jtjkr1||_q|jtjkr;||_qt|S r  )rT  rS  r   	argumentsr<  is_positionalrU  appendis_namedrV  r;  r   ARG_STARrW  	ARG_STAR2rX  r[  )r   stub_sig	stub_argsr+  r   r   r"   from_funcitem  s   

zSignature.from_funcitem	signatureinspect.SignatureSignature[inspect.Parameter]c                 C  s   t  }| j D ]9}|jtjjtjjfv r|j	| q|jtjj
kr*||j|j< q|jtjjkr5||_q|jtjjkr@||_qt|S r  )rT  
parametersrk  r<  rY   r=  r>  POSITIONAL_OR_KEYWORDrU  rs  KEYWORD_ONLYrV  r   VAR_POSITIONALrW  VAR_KEYWORDrX  r[  )rz  r\   r-  r   r   r"   from_inspect_signature  s   z Signature.from_inspect_signaturenodes.OverloadedFuncDefc              
     s  t jdd}i  ttjD ]A}|dusJ tj|j}t|D ]-\}}|jj	ds;|j
s;|s;|jjddkr@d| n|jj} |g ||f q"qd fdd}d fdd}d fdd}	t }
t |dD ]U} | d d jj}tjt|||dd|	|tdd  | D d}|j r|
j| qp|j r||
j|jj< qp|jtjkr||
_qp|jtjkr||
_qpt|
S )a  Returns a Signature from an OverloadedFuncDef.

        If life were simple, to verify_overloadedfuncdef, we'd just verify_funcitem for each of its
        items. Unfortunately, life isn't simple and overloads are pretty deceitful. So instead, we
        try and combine the overload's items into a single signature that is compatible with any
        lies it might try to tell.

        Tr  Nr  r  r!   arg_namer   r   r:   c                   s   t dd  |  D S )Nc                 s  s    | ]\}}|V  qd S r  r   )r   r  indexr   r   r"   r  L  s    zISignature.from_overloadedfuncdef.<locals>.get_position.<locals>.<genexpr>)max)r  all_argsr   r"   get_positionJ  s   z6Signature.from_overloadedfuncdef.<locals>.get_positionmypy.types.ProperTypec                   sZ   t jjd dd  |  D }t jdd |D W  d    S 1 s&w   Y  d S )NTc                 S  s   g | ]\}}|j jp|jqS r   )r;  rP   rF  r   rY  r  r   r   r"   rh  P  s    zFSignature.from_overloadedfuncdef.<locals>.get_type.<locals>.<listcomp>c                 S  s   g | ]}|r|qS r   r   r  r   r   r"   rh  S  ri  )r   statestrict_optional_settypeopsmake_simplified_union)r  	all_typesr  r   r"   r^  N  s   $z2Signature.from_overloadedfuncdef.<locals>.get_typenodes.ArgKindc                   s   dd  |  D }t j|v rt jS t j|v rt jS t |  tjk p-t j|v p-t j|v }t j|v p7t j|v }|rB|r?t jS t jS |rGt jS t jS )Nc                 S  s   h | ]\}}|j qS r   )r<  r  r   r   r"   r   V  s    zESignature.from_overloadedfuncdef.<locals>.get_kind.<locals>.<setcomp>)	r   ru  rv  r=   r   ARG_OPTARG_NAMED_OPTARG_POS	ARG_NAMED)r  kindsis_optis_posr  r   r   r"   get_kindU  s   

z2Signature.from_overloadedfuncdef.<locals>.get_kindrc  r   c                 s  s    | ]\}}|j V  qd S r  )pos_onlyr  r   r   r"   r  q  s    z3Signature.from_overloadedfuncdef.<locals>.<genexpr>)rF  rJ  r<  r  )r  r   r   r:   )r  r   r   r  )r  r   r   r  )r   r   map _resolve_funcitem_from_decoratorr   rS  rq  	enumerater;  r  r  r   r6   rs  rT  r   r   rZ  Varallr<  rr  rU  rt  rV  ru  rW  rv  rX  r[  )r   assume_positional_onlyfuncr4  r  rY  r   r  r^  r  sigr  example_arg_namer   r  r"   from_overloadedfuncdef,  sR   


z Signature.from_overloadedfuncdefNr   rN   r%   )r   ro  r   rp  )rz  r{  r   r|  )r   r  r   rp  )	r'   r(   r)   r_   rn  r'  ry  r  r  r   r   r   r"   rT    s    

)rT  rp  r|  c                 c  s   t | j|jD ]k\}}t|||E d H  t||E d H  |jtjjkrJ|jsJ|j	j
dsJ|j	j
ddkrJt|ddsJd|j	j
 d|j
 dV  |jtjjkrs|js[|j	j
drs|j	j
ddkrst|ddssd|j	j
 d	V  qt| jt|jkr|jd u r| jt|jd  D ]'}|j	j
|jvrd
|j	j
 d}|jd ur|d7 }|V  qd|j	j
 dV  q| jd urd| jj	j
 dV  n2t| jt|jk r|jt| jd  D ]}|j
| jvrt|sd|j
 dV  qd|j
 dV  qt| jt|jks|jd u r3| jd u r|jd urd|jj
 dV  | jd ur3|jd u r3d| jj	j
 dV  tt| jt|j@ D ]}| j| |j| }}t|||E d H  t||E d H  q?|jd u sqt|jt| jstt| jt|j D ]0}|dd |jD v r|dd |jt| jd  D vrd| dV  q}d
| dV  q}tt|jt| j D ]>}|dd | jD v r|jd u r|dd | jt|jd  D v sd| dV  qt|j| sd| dV  q| jd u r$|jd ur$dd | jD }t|jt| j|B s$d|jj
 dV  | jd ur<|jd u r>d| jj	j
 dV  d S d S d S )Nr  r  r!   Tr  r9  zN" should be positional-only (rename with a leading double underscore, i.e. "__z")zD" should be positional or keyword (remove leading double underscore)z runtime does not have argument "r:  z7. Maybe you forgot to make it keyword-only in the stub?z" is not keyword-onlyz&runtime does not have *args argument "zstub does not have argument "rA  z#stub does not have *args argument "c                 S     h | ]}|j qS r   r   r   r-  r   r   r"   r         z$_verify_signature.<locals>.<setcomp>c                 S  r  r   r  r  r   r   r"   r     r  c                 S     h | ]}|j jqS r   rR  r   r+  r   r   r"   r     ri  c                 S  r  r   rR  r  r   r   r"   r     ri  c                 S  r  r   rR  r  r   r   r"   r     ri  z&stub does not have **kwargs argument "z)runtime does not have **kwargs argument ")ziprU  r@  rO  r<  rY   r=  r>  r  r;  r   r  r   r   r=   rW  rV  rX  _is_private_parameterr   r   issubset)r   r   r/  r+  r-  msgrY  stub_pos_namesr   r   r"   _verify_signature  s   




"$$$r  rY  c                 C  s(   | j do| j d o| jtjjuS )Nr  r  )r   r  rB  rY   r=  rC  r\  r   r   r"   r    s
   r  ro  c                 c  sd   t |trt|d| |V  d S t|s"t|d| |V  t|s"d S t|}t | tjrMt| |D ]
}t||| |V  q1t	| ||D ]
}t||| |V  qBt
| |||D ]}t|d| | |V  qTt|}t|}|rt| }t|}	t||d}
t|}nd\}
}|r| jst|d| |||
dV  |sd S t||	| jdD ]}t|d| | ||
d	V  qd S )
Nr   is not a functionis inconsistent, rR   )NNz:is an "async def" function at runtime, but not in the stubrD   r/  r   )ra   r   rC   is_probably_a_functioncallabler  r   FuncDef_verify_abstract_status_verify_final_methodr*  rW   rY   rZ   rT  ry  r  r[   r   is_coroutiner  r   )r   r   rG   r  
error_textr2   rz  runtime_is_coroutinerw  r\   runtime_sig_descrE   r   r   r"   verify_funcitem  sX   





	
r  c                 c  s    t |d| |V  d S )Nzis not present in stubr   r   r   r   r"   verify_none2  s   r  	nodes.Varc                 c  s   t |trt|dkrt|d| |V  d S | jr+t|r+| js#| js+t|d| |V  t|}|d ur|| j	d ur~t
|| j	sd}t |tjrmt|j}|d urWt
|| j	rWd}tj| j	}t |tjjrm|j	jdkrmd}|rt|d| | |V  d S d S d S d S d S )N   r   +is read-only at runtime but not in the stubTFzbuiltins.ellipsisz#variable differs from runtime type )ra   r   r=   rC   is_initialized_in_classis_read_only_propertyis_settable_propertyis_propertyrE  rP   rI  r   r   valuer   r   get_proper_typeInstancer   )r   r   rG   rL  should_errorproper_typer   r   r"   
verify_var9  sH   




r  r  c           
   
   c  sT   t |trt|d| |V  d S | jr!t|rt|d| |V  d S t|s3t|d| |V  t|s3d S | jd }t |tj	rR|j
rRt|j|D ]
}t||| |V  qGt|}t| |||D ]}t|d| | |V  q]t|}|srd S t| }t|}	t||	| jdD ]#}d|v r|d7 }t|d| | |t| jd	|  d
t| dV  qd S )Nr   r  r  r   r  r  zhas a default value of typezc. This is often caused by overloads failing to account for explicitly passing in the default value.z
Inferred signature: def rD   )ra   r   rC   r  r  r  r  r   r   	Decoratoris_overloadr  r  r  r*  rW   rT  r  r  r  r   r   rP   )
r   r   rG   
first_partr  r  r2   rz  rw  r\   r   r   r"   verify_overloadedfuncdefe  sL   





r  nodes.TypeVarExprc                 c  sP    t |tr| jdkrd S t|d| |V  d S t |ts&t|d| |V  d S d S )N_NTr   zis not a TypeVar)ra   r   r   rC   r   r   r   r   r"   verify_typevarexpr  s   


r  nodes.ParamSpecExprc                 c  sp    t |trt|d| |V  d S ttdd ttdd f}tdd |D }|r,t ||s6t|d| |V  d S d S )Nr   	ParamSpecc                 s  s    | ]	}|d ur|V  qd S r  r   r  r   r   r"   r    s    z'verify_paramspecexpr.<locals>.<genexpr>zis not a ParamSpec)ra   r   rC   rV   typingtyping_extensionstuple)r   r   rG   maybe_paramspec_typesparamspec_typesr   r   r"   verify_paramspecexpr  s   


r  nodes.Decoratorc                 c  s    | j jsJ t|trt| j |jtE d H  d S t|tjr,t| j |j tE d H  d S t	
|r3d S t|}t| j jtjjrE| j jjnd }|d urV|d urVt||rVd S dV  d S )NzGis inconsistent, cannot reconcile @property on stub with runtime object)r  r  ra   propertyr  fgetr   	functoolscached_propertyrY   isdatadescriptorrE  rP   r   r   CallableTyperet_typerI  )r   r   rL  	func_typer   r   r"   _verify_readonly_property  s&   


r  nodes.FuncDefc                 c  sJ    | j tjk}t|dd}|r!|s#| jrdnd}d| dV  d S d S d S )N__isabstractmethod__Fr  methodzis inconsistent, runtime z is abstract but stub is not)abstract_statusr   IS_ABSTRACTrV   r  )r   r   stub_abstractruntime_abstract	item_typer   r   r"   r    s   r  c                 c  s>    | j rd S t|dds|turt|ddrdV  d S d S d S )Nr   Fz8is decorated with @final at runtime, but not in the stub)r   rV   r   )r   r   r  r   r   r"   r    s   
r  decnodes.OverloadPartnodes.FuncItem | Nonec                   s\   t  tjr S  jjrdS d
 fdd	} j} jD ]}|||}|du r) dS |}q|S )zReturns a FuncItem that corresponds to the output of the decorator.

    Returns None if we can't figure out what that would be. For convenience, this function also
    accepts FuncItems.
    N	decoratornodes.Expressionr  ro  r   r  c                   s   t | tjrt | jtjr| jjtjjv r|S t | tjsd S | js$d S | jdv s7| jtjj	v s7| jtjj
v r9|S | jdkrf|jd jjdvrWtd|jd jjd j t|}|jdd  |_|S d S )N)zbuiltins.staticmethodzabc.abstractmethodzbuiltins.classmethodr   )rQ  mcsmetaclszunexpected class argument name z in ri   )ra   r   CallExprcalleeRefExprr   r   r   DEPRECATED_TYPE_NAMESOVERLOAD_NAMESFINAL_DECORATOR_NAMESrq  r;  r   r@   copy)r  r  rm  r  r   r"   apply_decorator_to_funcitem  s2   



zE_resolve_funcitem_from_decorator.<locals>.apply_decorator_to_funcitem)r  r  r  ro  r   r  )ra   r   FuncItemr  r  original_decorators)r  r  r  r  resulting_funcr   r  r"   r    s   #

r  c                 c  s    | j jrt|tst|d| |t| dV  d S t|tr't|d| |V  d S | j jrNt| |D ]
}t||| |V  q0t| j |D ]
}t||| |V  qAd S t	| }|d urat
|||E d H  d S d S )Nr   r   r   )r  r  ra   r   rC   rX   r  r  r  r  r   )r   r   rG   r2   r  r   r   r"   verify_decorator+  s0   

r  nodes.TypeAliasc           
      c  s    t j| j}d| }t|trt|d| ||dV  d S t|p#|}t|t jjrt|t	s<t|d| ||dV  d S |j	}z|j
}W n tyS   t|dt}Y nw t|trt|dt}t|tr|dksp|dkrr|d	v rrd
}| d| }	tdt|j |	rd S t|||E d H  d S t|t jjr|turtjdkrt|tjst|d| |t|dV  d S t|t jjrtt|ddvrt|d| ||dV  d S t|t jjr|tjjurt|d| ||dV  d S t|t jjrd S t|d| ||dV  d S )NzType alias for r   r   z&is inconsistent, runtime is not a typer'   r(   zcollections.abcre>   MatchPatternr  rO   z_?r;   
   zis not a Union__mro__r   zis not a subclass of tuplez is not a type alias for Callablezis not a recognised type alias)r   r   r  targetra   r   rC   r   r  rP   r)   r  rV   r   r   r  	fullmatchescaper   r   	UnionTyper   r   version_info	TupleTyper  r  collectionsabcCallableAnyType)
r   r   rG   stub_targetrE   runtime_originstub_originruntime_nameruntime_moduleruntime_fullnamer   r   r"   verify_typealiasK  sl   







r  >   r*   __file__r'   __path____spec__
__author__
__cached__
__loader____getattr____package____version____builtins____copyright____annotations____warningregistry__r   >)   __cmp____div__r*   __args____dict____hash__r   	__slots__
__origin__
__reduce__r"  __nonzero____setattr____unicode____weakref____ctype_be____ctype_le____getstate____setstate____reduce_ex____getnewargs____new_member____orig_bases____parameters____pyx_vtable__r'  __firstlineno____getinitargs____subclasshook____instancecheck____subclasscheck____protocol_attrs____text_signature____abstractmethods____dataclass_fields____dataclass_params____vectorcalloffset____static_attributes____ctypes_from_outparam____non_callable_proto_members____callable_proto_members_only__r  c                 C  s   |  do	t|  S )Nr  )r  r   r  r   r   r"   r        r   c                 C  s6   t | tjtjfpt | tjtjfpt| ot| S r  )	ra   r   FunctionTypeBuiltinFunctionType
MethodTypeBuiltinMethodTyperY   ismethoddescriptorr  r   r   r   r"   r    s
   r  r3  c                 C  s   t | to	| jd u S r  )ra   r  fsetr   r   r   r"   r    rN  r  inspect.Signature | Nonec                 C  s   zDzt | W W S  tyD   t| drCd| jv rC| jdd}t t j| |}t|t js0J dd |j	
 D }|j|d Y W S  w  tyN   Y d S w )NrE  r/   r<   c                 S  s&   g | ]}|j d u r|jtdn|qS ).)rB  )rB  replacer0   )r   	parameterr   r   r"   rh    s    
z*safe_inspect_signature.<locals>.<listcomp>)r}  )rY   rz  
ValueErrorr   rE  rV  _signature_fromstrrT  ra   r}  rk  r   )r   r  
new_paramsr   r   r"   rW     s&   
rW   rz  r{  rS   c                C  s   |rdnd d|  S )Nzasync rg   r  r   )rz  rS   r   r   r"   r[     s   r[   leftmypy.types.Typerightc                 C  s   t j| } t j|}t| t jjr't| jtr'| jdv r't j|dr'dS t|t jjr7t j| dr7dS t j	j	
d t j| |W  d   S 1 sPw   Y  dS )z2Checks whether ``left`` is a subtype of ``right``.)r   ri   zbuiltins.boolTzbuiltins.dictN)r   r   r  ra   LiteralTyper  r:   r   TypedDictTyper  r  subtypes
is_subtype)r[  r]  r   r   r"   rI    s"   

$rI  mypy.types.Type | Nonec                   s  | du r	t j S t| trdS ddd t| tjtjtjtjfrt	d}|dus,J |j
d j}t|tjs:J t j|  g}t| }|rg }g }g }|j D ]t}|   ||jtjjkrgdn|j |jtjjk}	|jtjjkr||	rtjntj qT|jtjjkr||	rtjntj qT|jtjjkr||	rtjntj qT|jtjj kr|tj! qT|jtjj"kr|tj# qTt$n    g}tj!tj#g}ddg}t jj%|||  |dd	S t	t&| j'}
|
du rdS t&| j(}||
j
vrdS |
j
| j}t|tj)r|j&S t|tjsdS t| t*r@d
d | D } fdd|D }t j|  g}t j+||S t j| fdd|j,D }t| t-j.rat| jt/ra| j}nt| t0rlt1| }nt| t2t3t/frx| }n|S t jj4||dS )zReturns a mypy type object representing the type of ``runtime``.

    Returns None if we can't find something that works.

    Nr   mypy.types.AnyTypec                   S  s   t jt jjjS r  )r   r   r  	TypeOfAnyunannotatedr   r   r   r"   anytype?  s   z/get_mypy_type_of_runtime_value.<locals>.anytypebuiltinsfunctionT)r  fallbackis_ellipsis_argsc                 S  s   g | ]}t |qS r   )rE  )r   vr   r   r"   rh    ri  z2get_mypy_type_of_runtime_value.<locals>.<listcomp>c                   s   g | ]}|d ur
|n  qS r  r   )r   irf  r   r"   rh    s    c                   s   g | ]}  qS r   r   )r   r  rm  r   r"   rh    r  )r  ri  )r   rc  )5r   r   NoneTypera   r  rO  rP  rQ  rR  rp   r   r   r   TypeInfor  rW   r}  rk  rs  r<  rY   r=  r>  r   rB  rC  r  r  r~  r  r  r  r  ru  r  rv  r[  r  rP   r(   r'   r  r  r  	type_varsr   r   r   bytesr   r`   r:   r^  )r   rg  	type_infori  rz  	arg_types	arg_kinds	arg_namesrY  r_  r   	type_nameoptional_itemsr   r  r   rm  r"   rE  3  s   





rE  zdict[str, nodes.MypyFile]
_all_stubsr   optionsr   find_submodulesc              
     sd  t j }t jg ||}t jj|d|d}g  g }| D ]`} | |s<||}t|t	s0q|t j
||d q||}	||	   fdd|	D  zt|}
  fddt|
j|
jd D  W q tyt     ty|   Y qw |rz
t jj||d}W n t jjy } ztd| |d}~ww |jrtd	d
|j |ja S )a  Uses mypy to construct stub objects for the given modules.

    This sets global state that ``get_stub`` can access.

    Returns all modules we might want to check. If ``find_submodules`` is False, this is equal
    to ``modules``.

    :param modules: List of modules to build stubs for.
    :param options: Mypy options for finding and building stubs.
    :param find_submodules: Whether to attempt to find submodules of the given modules as well.

    N)fscachery  c                 3       | ]}|j  vr|j V  qd S r  module)r   r0  all_modulesr   r"   r    s    zbuild_stubs.<locals>.<genexpr>c                 3  r|  r  r  r   r  r   r"   r    s    
rO   )sourcesry  zfailed mypy compile:
zmypy build errors:
rl   )r   builddefault_data_dirmodulefindercompute_search_pathsFindModuleCachers  find_modulera   r   BuildSourcefind_modules_recursiveextendr   pkgutilwalk_packagesr  r'   r   r   errorsCompileErrorr@   rT   filesrx  )r   ry  rz  data_dirsearch_pathfind_module_cacher  r~  module_pathfound_sourcesr   resr   r   r  r"   build_stubs  sL   





r  r~  nodes.MypyFile | Nonec                 C  s
   t | S )z?Returns a stub object for the given module, if we've built one.)rx  r   r}  r   r   r"   rp     s   
rp   custom_typeshed_dirrM   r  tuple[int, int] | Nonec                   s   t j|  du rtjdd d fdd	}| r t| }n	tt j d
 }|d }t }|	dD ]$}|j
dkr?|j}d||jdd |j
f }||rY|| q5|S )zJReturns a list of stdlib modules in typeshed (for current Python version).Nr   r  r~  r   r   r`   c                   sr   d usJ |  d}tt|ddD ]#}d|d | }| v r6 | \}}|ko3|d u p3|k  S qdS )NrO   r   r   F)r   ranger=   rT   )r~  partsrl  current_moduleminvermaxverstdlib_py_versionsr  r   r"   exists_in_version  s   
z6get_typeshed_stdlib_modules.<locals>.exists_in_versiontypeshedstdlibz*.pyir_   rO   r   )r~  r   r   r`   )r   r  load_stdlib_py_versionsr   r  r   r  r  r   rglobstemparentrT   relative_tor  add)r  r  r  typeshed_dir
stdlib_dirr   rq   r~  r   r  r"   get_typeshed_stdlib_modules  s"   


"
r  c               
   C  sb  t jdkr	t j} n=tt j} tt}t D ]}t|j	t
jjr)||j	 |j q| D ]\}}dt|jjvrEddh|@ rE| | q.t }| D ]c}|tv rRqKzt|}W n	 tya   Y qKw || z|j}|j}	W n	 tyx   Y qKw t||	d D ],}
|
j}|ds|drqzt| W n ty     ty   Y qw || qqK|S )z0Return all importable stdlib modules at runtime.r  zsite-packages_queuequeuerO   z	.__main__)zidlelib.ztest.)r   r  stdlib_module_namesr   builtin_module_namesr   r  iter_modulesra   module_finderr   	machinery
FileFinderr  r   r   r   rq   r  r   ANNOYING_STDLIB_MODULESr   ImportErrorr  r'   r  r  r  r  r   r   )all_stdlib_modulesmodules_by_finderr   findermodule_groupimportable_stdlib_modulesr   r   runtime_pathr  	submodulesubmodule_namer   r   r"   get_importable_stdlib_modules  s\   



	

r  allowlist_filec                 c  sV    ddd}t | }|D ]}||}|r|V  qW d    d S 1 s$w   Y  d S )Nr0  r   r   c                 S  s4   z| d |  d  W S  ty   |   Y S w )N#)r  r   rX  )r0  r   r   r"   strip_commentsM  s
   z-get_allowlist_entries.<locals>.strip_comments)r0  r   r   r   )r   )r  r  fro   r   r   r   r"   get_allowlist_entriesL  s   

"r  c                   @  sf   e Zd ZU ded< ded< ded< ded< ded< ded< ded	< d
ed< d
ed< ded< ded< dS )
_ArgumentsrH   r   r`   rd   ignore_missing_stubignore_positional_only	allowlistgenerate_allowlistignore_unused_allowlistrM   mypy_config_filer  check_typeshedr   versionN)r'   r(   r)   r'  r   r   r   r"   r  Z  s   
 r  >   thisr   antigravity_ios_supportr  use_builtins_fixturesc                 C  s  dd | j D }dd |D }t }| j}| jr7| jr'ttddddd d	S t| j}t }t	||B t
 }|sEttddddd
 d	S t }d|_| j|_|jrZtj|j|_| j|_||_|jrtd'dd}	t||	|jtjtj d(dd}
d)dd}|j|
d |j|
|d zt||| j d}W n  ty } zttddddd|  W Y d}~d	S d}~ww d}d}|D ]X}t|D ]Q}| jr| rq| jr|  rq|j!|v rd||j!< qd}|D ]}|| "|j!rd||< d} nq|rqd	}| j#r|$|j! qt|j%| j&d |d	7 }qq| j's:|D ]}|| s8|| "ds8d	}|d	7 }td|  q| j#rNt	|D ]}t| qBd}|S | j&s|rsttd | d!t(| d"t)| d#t(| d$	ddd |S ttd%t)| d#t(| d&dd |S )*z.This is stubtest! It's time to test the stubs!c                 S  s    i | ]}t |D ]}|d qqS r   )r  )r   r  r   r   r   r"   
<dictcomp>r  s    ztest_stubs.<locals>.<dictcomp>c                 S  s   i | ]}|t |qS r   )r  compile)r   r   r   r   r"   r  w  r  error:rj   Trk   z7cannot pass both --check-typeshed and a list of modulesri   zno modules to checkFr   rN   c                   S  s   d S r  r   r   r   r   r"   set_strict_flags  r$   z$test_stubs.<locals>.set_strict_flagsr  r   typing.NoReturnc                 S  s"   t tdddd|  td d S )Nr  rj   Trk   ri   )printr8   r   exitr  r   r   r"   error_callback  s   z"test_stubs.<locals>.error_callbackc                 S  s   t tdddd|  d S )Nzwarning:yellowTrk   )r  r8   r  r   r   r"   warning_callback  s   z$test_stubs.<locals>.warning_callback)r  )r  r  )rz  znot checking stubs due to Nr   )rd   rg   znote: unused allowlist entry zFound z errorz
 (checked z modulerj  zSuccess: no issues found in greenr  )r  r   r   r  )r  r   r   rN   )*r  r   r   r  r  r8   r  r  r  r   r  r   incrementalr   rq   abspathabs_custom_typeshed_dirr  config_filer  r   r   stdoutstderrprocess_error_codesprocess_incomplete_featuresr  r@   r   r  rb   r  rc   rU   r  r  r  r   rd   r  r   r=   )r4  r  r  allowlist_regexesgenerated_allowlistr   typeshed_modulesruntime_modulesry  r  r  r  stubtest_failure	exit_codeerror_countr~  erroris_allowlistedr   r   r   r   r"   
test_stubsn  s   






r  c                 C  s   t jdd}|jdddd |jddd	d
 |jdddd
 |jdddd
 |jddddg dd |jddddd
 |jddddd
 |jdddd |jddd d |jd!dd"d
 |jd#d$d%tjj d& |j| t d'S )(Nz8Compares stubs to objects introspected from the runtime.)r^   r   r   zModules to test)nargshelpz	--concise
store_truez8Makes stubtest's output more concise, one line per error)actionr  z--ignore-missing-stubzAIgnore errors for stub missing things that are present at runtimez--ignore-positional-onlyzLIgnore errors for whether an argument should or shouldn't be positional-onlyz--allowlistz--whitelistrs  FILEzUse file as an allowlist. Can be passed multiple times to combine multiple allowlists. Allowlists can be created with --generate-allowlist. Allowlists support regular expressions.)r  metavarrB  r  z--generate-allowlistz--generate-whitelistz:Print an allowlist (to stdout) to be used with --allowlistz--ignore-unused-allowlistz--ignore-unused-whitelistzIgnore unused allowlist entriesz--mypy-config-filezFUse specified mypy config file to determine mypy plugins and mypy path)r  r  z--custom-typeshed-dirDIRzUse the custom typeshed in DIRz--check-typeshedz$Check all stdlib modules in typeshedz	--versionr  z	%(prog)s )r  r  )	namespace)argparseArgumentParseradd_argumentr   r  r$  
parse_argsr  )r4  parserr   r   r"   parse_options  sl   r  c                   C  s"   t jd tttjdd  S )Nstubtestri   )r   utilcheck_python_versionr  r  r   argvr   r   r   r"   main0  s   r  r   )r2   r   r3   r	   r   r   )r2   r   r9   r:   r   r   )r   r   r   r   )r   r   r   r   )r   rJ   r   rL   rG   rH   r   r   )rG   rH   r   r   r   r   r   r   )r   r   r   r   )r   r   r   r   rG   rH   r   r   )r   r   r   r   rG   rH   r   r   )
r   r   r   r   rG   rH   r   r`   r   r   )r   r   r   r   rG   rH   r   r   )rG   rH   r   rL   )
r   r  r   r	   r  rL   rG   rH   r   r   )r+  r,  r-  r.  r/  r   r   r   )r+  r,  r-  r.  r   r   )r   r   r4  rP  r   rP  )r   rp  r   r|  r/  r   r   r   )rY  r.  r   r`   )r   ro  r   rL   rG   rH   r   r   )r   r   r   rL   rG   rH   r   r   )r   r  r   rL   rG   rH   r   r   )r   r  r   rL   rG   rH   r   r   )r   r  r   rL   rG   rH   r   r   )r   r  r   rL   rG   rH   r   r   )r   r  r   r	   r   r   )r   r  r   r	   r   r   )r   r  r   r	   r  rL   r   r   )r  r  r   r  )r   r  r   rL   rG   rH   r   r   )r   r  r   rL   rG   rH   r   r   )r   r   r   r`   )r   r	   r   r`   )r   r3  r   r`   )r   r	   r   rU  )rz  r{  rS   r`   r   r   )r[  r\  r]  r\  r   r`   )r   r	   r   rb  r   )r   rH   ry  r   rz  r`   r   rH   )r~  r   r   r  r  )r  rM   r  r  r   r   )r   r   )r  r   r   r   )r4  r  r  r`   r   r:   )r4  rH   r   r  )r   r:   )r*   
__future__r   r  collections.abcr  r  r   r  r   importlib.machineryrY   r   r  r  r   r   r   r   r  r  r   r   
contextlibr   r   r   pathlibr   r   r	   r
   r   r   r   r   r   
mypy.buildr   mypy.modulefinder
mypy.nodes
mypy.state
mypy.typesmypy.versionr   mypy.config_parserr   mypy.evalexprr   r   mypy.optionsr   	mypy.utilr   r   r   r   r   r   r'  r,   r-   r.   r0   r  r  r1   r8   r>   r   r@   rC   r   r   r   r   	lru_cacher   registerr   r   r   r   ro  r  r  r*  r@  rO  rS  rT  r  r  r   r  r  r  r  OverloadedFuncDefr  TypeVarExprr  ParamSpecExprr  r  r  r  r  r  r  	TypeAliasr  	frozensetr   r  r   r  r  rW   r[   rI  rE  rx  r  rp   r  r  r  r  r  r  r  r  r'   r  r   r   r   r"   <module>   s     


q
8


]
'
&
M


%
;	 
)
l
=

+
?



	

7
L
9



!

e
=
"
M 

>
