Your IP : 18.117.156.26


Current Path : /proc/self/root/opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python35/lib64/python3.5/__pycache__/typing.cpython-35.opt-2.pyc



���]9�D@sKddlZddlmZmZddlZddlZddlZddlZddlZddl	Z	yddl
jZWnek
r�ddlZYnXej
dd�ddfkr�ddlZy ddl	mZmZmZWnBek
r-eej�Zee�j�Zeej�ZYnXddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:g4Zd;d<�Zd=d>�ZGd?d@�d@e�ZGdAdB�dBdCedDdE�ZGdFdG�dGedDdE�ZGdHdI�dIedDdE�ZGdJdK�dKedDdE�ZdLdM�Z dNdO�Z!dPdQ�Z"dRdS�Z#dTdU�Z$GdVdW�dWedDdE�Z%e%dDdE�Z&GdXdY�dYedDdE�Z'e'dDdE�Z(GdZd�dedDdE�Z)e)d[�Z*e)d\�Z+e)d]�Z,e)d^d_dE�Z-e)d`d_dE�Z.e)dad_dE�Z/e)dbdcdE�Z0e)d2e1e�Z2ddde�Z3dddfdg�Z4dhdi�Z5djdk�Z6gZ7dldm�Z8Gdndo�doedDdE�Z9e9dDdE�Z:Gdpdq�dqedDdE�Z;e;dDdE�Z<drds�Z=dtdu�Z>dvdw�Z?dxdy�Z@dzd{�ZAGd|d�deejB�ZCdZDd}d~�ZEGdd
�d
dCeC�ZDGd�d��d��ZFGd�d��d��ZGGd�d��d�eC�ZHGd�d�deId�eIdCeH�ZJGd�d��d�eC�ZKGd�d�dd�ejLdCeK�ZLGd�d��d�edDdE�ZMeMdDdE�ZNd�d3�ZOd�d��ZPe	jQe	jRe	jSe	jTeeefZUddd�d4�ZVd�d6�ZWd�d7�ZXd�d��ZYd�d8�ZZGd�d��d�eC�Z[Gd�d��d�dCe[�Z\ej]Z]e^ed��rwGd�d��d�eDe-d�ej_�Z_ej`d��e^ed��r�Gd�d��d�e_e.eDe-e0e.fd�eja�Zaej`d��e^ed��r5Gd�d��d�eDe-d�ejb�ZbGd�d��d�ebe-d�ejc�Zcej`d��ej`d��Gd�d�deDe-d�ejd�ZdGd�d�dede-d�eje�ZeGd�d'�d'e\�ZfGd�d&�d&e\�ZgGd�d%�d%e\�ZhGd�d$�d$e\�ZiGd�d#�d#e\e-�ZjGd�d(�d(e\e-�Zke^ed"�r<Gd�d"�d"ede-d�ejl�ZlnGd�d"�d"e\e-�ZlejmZmGd�d�deDe-d�ejn�Zne^ed��r�Gd�d��d�emede-ene-d�ejo�Zoej`d��e^ed��r	Gd�d�deoe-d�ejp�Zqn-Gd�d�demede-ene-d�ejp�ZqGd�d�deqe*d�ejr�Zre^ed��r�	Gd�d�deoe+eDe+e/fd�ejs�Zsn:Gd�d�demede+ene+eDe+e/fd�ejs�ZsGd�d�dese+e,fd�ejt�Zte^ed"�rp
e^ed��r@
Gd�d�dele-eoe-d�eju�Zun-Gd�d�demele-ene-d�eju�Zun-Gd�d�demede-ene-d�eju�ZuGd�d�deue*d�ejv�ZvGd�d�deuewd�ejx�ZxGd�d-�d-eyeve*d�ey�ZzGd�d*�d*ej{eve*d�ej{�Z|Gd�d.�d.e}ere*d�e}�ZpGd�d/�d/e~eqe-d�e~�ZGd�d�demede-d�ej��Z�Gd�d�de�e+eqe+d�ej��Z�Gd�d�de�eJe+e/feqeJe+e/feDe+e/fd�ej��Z�Gd�d!�d!e�e/d�ej��Z�e^ed��rhGd�d�deDe-d�ej��Z�nGd�d�deDe-�Z�e^ed��r�Gd�d��d�eDe-d�ej��Z�ej`d��n)ej
dd�dd�fkr�e�d��Gd�d+�d+e�ete+e,fd�e��Z�Gd�d,�d,ej�ete+e,fd�ej��Z�Gd�d)�d)ej�e�e*ewfd�ej��Z�e^ed��r�
ej`d��Gd�d��d�ej�ete+e,fd�ej��Z�e^ed1�r�
ej�Z�n	e	j�Z�Gd�d1�d1eee-eDe-e0e.fd�e��Z�e^ed��r_Gd�d��d�ece-eDe-e0fd�ej��Z�ej`d��e)d�d_dEd�e�Z�Gd�d
�d
eDe�d�e�Z�d�d��Z�ej
dd�ddfkZ�d�d�d�d�d�d�d�d�d�d�d�fZ�d�d�d�d�fZ�Gd�d��d�e�Z�Gd�d0�d0dCe��Z�d�d5�Z�eZ�d�Z�Gd�d��d�eDe2�Z�Gd�d��d�e�e1�Z�Gd�d��d�e�e�Z�Gd�d��d��Z�e�d�e�_�e�ej�e�j�<ed�e2eej�d���d�d���Z�ed�e2eej�d�d���d�d���Z�Gd�d��d��Ze�d�e_�eej�ej�<dS)��N)�abstractmethod�abstractproperty���)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�Any�Callable�ClassVar�Generic�Optional�Tuple�Type�TypeVar�Union�AbstractSet�GenericMeta�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�SupportsInt�
SupportsRound�Counter�Deque�Dict�DefaultDict�List�Set�	FrozenSet�
NamedTuple�	Generator�AnyStr�cast�get_type_hints�NewType�
no_type_check�no_type_check_decorator�overload�Text�
TYPE_CHECKINGcCs+tjdd�dkr |jS|jSdS)Nrr)rr)�sys�version_info�__qualname__�__name__)�x�rC�+/opt/alt/python35/lib64/python3.5/typing.py�	_qualnamegsrEcCs5d}|jd�r1||kr1|dd�}|S)N�
_TypeAlias�_ForwardRef�_TypingBase�_FinalTypingBase�_�)rFrGrHrI)�
startswith)ZnmZ	whitelistrCrCrD�
_trim_nameosrMcs^eZdZdZdd�fdd�Zdd�Zdd�Zd	d
�Zdd�Z�S)
�
TypingMetaF�_rootcsG|s.tddjtt|��p'd��t�j||||�S)NzCannot subclass %sz, z())�	TypeError�join�map�
_type_repr�super�__new__)�cls�name�bases�	namespacerO)�	__class__rCrDrU�s"zTypingMeta.__new__cOsdS)NrC)�self�args�kwdsrCrCrD�__init__�szTypingMeta.__init__cCs|S)NrC)r[�globalns�localnsrCrCrD�
_eval_type�szTypingMeta._eval_typecCsdS)NrC)r[�tvarsrCrCrD�_get_type_vars�szTypingMeta._get_type_varscCs#tt|��}d|j|fS)Nz%s.%s)rMrE�
__module__)r[�qnamerCrCrD�__repr__�szTypingMeta.__repr__)	rArdr@�_is_protocolrUr^rarcrfrCrC)rZrDrNvs

rNcsdeZdZdZdd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Z	�S)rH�__weakref__cOsdS)NrC)r[r\r]rCrCrDr^�sz_TypingBase.__init__csXt|�dkrHt|dt�rHt|dt�rHtd|��t�j|�S)NrrrKzCannot subclass %r)�len�
isinstance�str�tuplerPrTrU)rVr\r])rZrCrDrU�s
z_TypingBase.__new__cCs|S)NrC)r[r_r`rCrCrDra�sz_TypingBase._eval_typecCsdS)NrC)r[rbrCrCrDrc�sz_TypingBase._get_type_varscCs/t|�}tt|��}d|j|fS)Nz%s.%s)�typerMrErd)r[rVrerCrCrDrf�sz_TypingBase.__repr__cOstdt|���dS)NzCannot instantiate %r)rPrm)r[r\r]rCrCrD�__call__�sz_TypingBase.__call__)rh)
rArdr@�	__slots__r^rUrarcrfrnrCrC)rZrDrH�srH�	metaclassrOTcs:eZdZfZdd�fdd�Zdd�Z�S)rIrOFcs<t�j|||�}|dkr(|Std|��dS)NTzCannot instantiate %r)rTrUrP)rVrOr\r]r[)rZrCrDrU�sz_FinalTypingBase.__new__cCstt|�j�S)N)rMrmrA)r[rCrCrD�
__reduce__�sz_FinalTypingBase.__reduce__)rArdr@rorUrqrCrC)rZrDrI�srIcspeZdZdZ�fdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
�S)rG�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__cs�t�j|�t|t�s2td|f��yt|dd�}Wn%tk
rotd|f��YnX||_||_d|_	d|_
dS)Nz,Forward reference must be a string -- got %rz<string>�evalz1Forward reference must be an expression -- got %rF)rTr^rjrkrP�compile�SyntaxErrorrrrsrtru)r[�arg�code)rZrCrDr^�s
			z_ForwardRef.__init__cCs�|js||k	r�|dkr;|dkr;i}}n'|dkrP|}n|dkrb|}tt|j||�d�|_d|_|jS)Nz*Forward references must evaluate to types.T)rt�_type_checkrvrsru)r[r_r`rCrCrDra�s
		z_ForwardRef._eval_typecCs5t|t�stS|j|jko4|j|jkS)N)rjrG�NotImplementedrrru)r[�otherrCrCrD�__eq__�sz_ForwardRef.__eq__cCst|j|jf�S)N)�hashrrru)r[rCrCrD�__hash__sz_ForwardRef.__hash__cCstd��dS)Nz4Forward references cannot be used with isinstance().)rP)r[�objrCrCrD�__instancecheck__sz_ForwardRef.__instancecheck__cCstd��dS)Nz4Forward references cannot be used with issubclass().)rP)r[rVrCrCrD�__subclasscheck__sz_ForwardRef.__subclasscheck__cCsd|jfS)Nz_ForwardRef(%r))rr)r[rCrCrDrf	sz_ForwardRef.__repr__)rrrsrtru)rArdr@ror^rar~r�r�r�rfrCrC)rZrDrG�srGc@sjeZdZdZdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dS)rFrW�type_var�	impl_type�type_checkercCs(||_||_||_||_dS)N)rWr�r�r�)r[rWr�r�r�rCrCrDr^s			z_TypeAlias.__init__cCsd|jt|j�fS)Nz%s[%s])rWrSr�)r[rCrCrDrf,sz_TypeAlias.__repr__cCs�t|jt�s"td|��|jjrkt|t�rkt||jj�sktd||jf��t|t�r�||jk	r�td|��|j|j||j	|j
�S)Nz#%s cannot be further parameterized.z&%s is not a valid substitution for %s.z%s cannot be re-parameterized.)rjr�rrP�__constraints__rm�
issubclassrZrWr�r�)r[Z	parameterrCrCrD�__getitem__/sz_TypeAlias.__getitem__cCs5t|t�stS|j|jko4|j|jkS)N)rjrFr|rWr�)r[r}rCrCrDr~;sz_TypeAlias.__eq__cCst|j|jf�S)N)rrWr�)r[rCrCrDr�@sz_TypeAlias.__hash__cCs.t|jt�std��t||j�S)Nz<Parameterized type aliases cannot be used with isinstance().)rjr�rrPr�)r[r�rCrCrDr�Csz_TypeAlias.__instancecheck__cCs.t|jt�std��t||j�S)Nz<Parameterized type aliases cannot be used with issubclass().)rjr�rrPr�r�)r[rVrCrCrDr�Isz_TypeAlias.__subclasscheck__N)rWr�r�r�)rArdr@ror^rfr�r~r�r�r�rCrCrCrDrF
s	rFcCs@x9|D]1}t|t�s+t|t�r|j|�qWdS)N)rjrNrHrc)�typesrb�trCrCrDrcPs
rccCsg}t||�t|�S)N)rcrl)r�rbrCrCrD�
_type_varsVs
r�cCs2t|t�st|t�r.|j||�S|S)N)rjrNrHra)r�r_r`rCrCrDra\sracCs�|dkrtd�St|t�r1t|�}t|t�rUt|�jdksxt|ttf�r�t|�r�t|d|f��t|�jdkr�t|dd�s�t|t	�r�t
|�ttfkr�td|��|S)N�	_ClassVarz Got %.100r.�_Union�	_Optional�
__origin__z&Plain %s is not valid as type argument)r�r�)
rmrjrkrGrHrA�callablerP�getattrrN�_gorgr
�	_Protocol)ry�msgrCrCrDr{bs
$#'r{cCs�t|t�rOt|t�rO|jdkr8t|�Sd|jt|�fS|dkr_dSt|tj�rx|jSt|�S)N�builtinsz%s.%s.z...)	rjrmrNrdrEr��FunctionTyperA�repr)r�rCrCrDrS�s
rSc@s.eZdZfZdd�Zdd�ZdS)�_AnycCstd��dS)Nz%Any cannot be used with isinstance().)rP)r[r�rCrCrDr��sz_Any.__instancecheck__cCstd��dS)Nz%Any cannot be used with issubclass().)rP)r[rVrCrCrDr��sz_Any.__subclasscheck__N)rArdr@ror�r�rCrCrCrDr��sr�c@s.eZdZfZdd�Zdd�ZdS)�	_NoReturncCstd��dS)Nz*NoReturn cannot be used with isinstance().)rP)r[r�rCrCrDr��sz_NoReturn.__instancecheck__cCstd��dS)Nz*NoReturn cannot be used with issubclass().)rP)r[rVrCrCrDr��sz_NoReturn.__subclasscheck__N)rArdr@ror�r�rCrCrCrDr��s
r�c	sjeZdZdZdddd	d
d	�fdd�Zd
d�Zdd�Zdd�Zdd�Z�S)rrA�	__bound__r��
__covariant__�__contravariant__�boundN�	covariantF�
contravariantc	s�t�j||d|d|d|�||_|rF|rFtd��t|�|_t|�|_|r�|dk	r�td��|r�t|�dkr�td��d�t	�fd	d
�|D��|_
|r�t|d�|_n	d|_dS)Nr�r�r�z"Bivariant types are not supported.z-Constraints cannot be combined with bound=...rKz"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3s|]}t|��VqdS)N)r{)�.0r�)r�rCrD�	<genexpr>sz#TypeVar.__init__.<locals>.<genexpr>zBound must be a type.)
rTr^rA�
ValueError�boolr�r�rPrirlr�r{r�)r[rWr�r�r�Zconstraints)rZ)r�rDr^�s 
	"zTypeVar.__init__cCs||kr|j|�dS)N)�append)r[rbrCrCrDrcszTypeVar._get_type_varscCs5|jrd}n|jr$d}nd}||jS)N�+�-�~)r�r�rA)r[�prefixrCrCrDrf
s				zTypeVar.__repr__cCstd��dS)Nz0Type variables cannot be used with isinstance().)rP)r[�instancerCrCrDr�szTypeVar.__instancecheck__cCstd��dS)Nz0Type variables cannot be used with issubclass().)rP)r[rVrCrCrDr�szTypeVar.__subclasscheck__)rAr�r�r�r�)	rArdr@ror^rcrfr�r�rCrC)rZrDr�s*		�T�KT�VT�T_cor��V_co�VT_co�T_contrar�cCs�|dkrg}t|d�rFt|ttf�rF|j||�St|t�r�x.t|�D] \}}||krb||SqbW|S)N�
_subs_tree)�hasattrrjrrHr�r�	enumerate)ryrbr\�iZtvarrCrCrD�_replace_arg)s$r�c	Cs�|jdkr|S|j}g}x)|jdk	rM|j|�|j}q%Wg}x*|jD]}|jt|||��q^WxJ|D]B}g}x-|jD]"}|jt||j|��q�W|}q�W|S)N)r�r��__args__r��__parameters__)	rVrbr\�currentZ
orig_chain�	tree_argsryZoclsZ
new_tree_argsrCrCrDr�Ds 	


 
r�cs�g}x�|D]�}t|t�rD|jtkrD|j|j�q
t|t�r�t|�dkr�|dtkr�|j|dd��q
|j|�q
Wt	|��t��t|�krg}x4|D],}|�kr�|j|��j
|�q�W|}t	|��xS|D]K�t�t�s2qt�fdd���hD��r�j
��qWt�fdd�|D��S)NrrKc3sK|]A}t|t�o$|jdk	st|t�oBt�|�VqdS)N)rjrr�rmr�)r�Zt2)�t1rCrDr��sz'_remove_dups_flatten.<locals>.<genexpr>c3s!|]}|�kr|VqdS)NrC)r�r�)�
all_paramsrCrDr��s)
rjr�r�r�extendr�rlrir��set�removerm�any)�
parameters�params�pZ
new_paramsr�rC)r�r�rD�_remove_dups_flattenes.
1


r�cCs~|jstdt|���t|�}t|j�}||krztd||kr^dndt|�||f��dS)Nz%s is not a generic classz0Too %s parameters for %s; actual %s, expected %sZmanyZfew)r�rPr�ri)rVr�ZalenZelenrCrCrD�_check_generic�s	r�csJtj����tj�j�tj����fdd��}|S)Ncs3y�||�SWntk
r%YnX�||�S)N)rP)r\r])�cached�funcrCrD�inner�s

z_tp_cache.<locals>.inner)�	functools�	lru_cache�	_cleanupsr��cache_clear�wraps)r�r�rC)r�r�rD�	_tp_cache�s$r�cs�eZdZdZdddd�fdd	�Zd
d�Zdd
�Z�fdd�Z�fdd�Ze	dd��Z
dddd�Zdd�Zdd�Z
dd�Zdd�Z�S)r�r�r�r��
__tree_hash__NrOFcst�j||||d|�}|dkrad|_d|_d|_ttd��|_|St|t	�s|t
d��|tkr�t|�}t
|�dkr�|dSt|�|_||_||_|j�}t|t	�rtt|��|_nt|�|_|S)NrOrzExpected parameters=<tuple>rKr)r)rTrUr�r�r�r�	frozensetr�rjrlrPrr�rir�r�)rVr��originrOr\r[Z	subs_tree)rZrCrDrU�s*!					z_Union.__new__cs�|jdkr|St��fdd�|jD��}t|j���}||jkro||jkro|S|j||dd�S)Nc3s!|]}t|���VqdS)N)ra)r�r�)r_r`rCrDr��sz$_Union._eval_type.<locals>.<genexpr>rOT)r�rlrar�rZ)r[r_r`�ev_args�	ev_originrC)r_r`rDra�s%z_Union._eval_typecCs&|jr"|jr"t|j|�dS)N)r�r�rc)r[rbrCrCrDrcsz_Union._get_type_varscsR|jdkrt�j�S|j�}t|t�sAt|�S|dj|�S)Nr)r�rTrfr�rjrlr��
_tree_repr)r[�tree)rZrCrDrfs

z_Union.__repr__cs~g}xW|dd�D]E}t|t�sB|jt|��q|j|dj|��qWt�j�ddj|�S)NrKrz[%s]z, )rjrlr�rSr�rTrfrQ)r[r��arg_listry)rZrCrDr�
sz_Union._tree_reprcs�|fkrtd��t|t�s0|f}|jdkrHd�nd�t�fdd�|D��}|tk	r�t||�|j|d|dd�S)	Nz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.z*Parameters to generic types must be types.c3s|]}t|��VqdS)N)r{)r�r�)r�rCrDr� sz%_Union.__getitem__.<locals>.<genexpr>r�rOT)rPrjrlr�rr�rZ)r[r�rC)r�rDr�s		
z_Union.__getitem__cCsS|tkrtSt|||�}t|�}t|�dkrH|dStf|S)NrKr)rr�r�ri)r[rbr\r�rCrCrDr�%sz_Union._subs_treecCsIt|t�r|j|jkS|tk	r;|j�|kS||kSdS)N)rjr�r�rr�)r[r}rCrCrDr~.s
z
_Union.__eq__cCs|jS)N)r�)r[rCrCrDr�6sz_Union.__hash__cCstd��dS)Nz(Unions cannot be used with isinstance().)rP)r[r�rCrCrDr�9sz_Union.__instancecheck__cCstd��dS)Nz(Unions cannot be used with issubclass().)rP)r[rVrCrCrDr�<sz_Union.__subclasscheck__)r�r�r�r�)rArdr@rorUrarcrfr�r�r�r�r~r�r�r�rCrC)rZrDr��s,
		r�c@s(eZdZfZedd��ZdS)r�cCs#t|d�}t|td�fS)Nz#Optional[t] requires a single type.)r{rrm)r[ryrCrCrDr�Ksz_Optional.__getitem__N)rArdr@ror�r�rCrCrCrDr�Csr�cCs#x|jdk	r|j}qW|S)N)r�)�arCrCrDr�Ts
r�cCst|�t|�kS)N)r�)r��brCrCrD�_geqv\sr�cCsft}xYt|jdd��D]>\}}t|t�r t|�tkr |j|d}q W|S)NrK���)�objectr��__mro__rjrr�r
)rVZnext_in_mror��crCrCrD�_next_in_mroks
&!r�cs@t�jtj�r*�fdd�}n�fdd�}|S)Ncs{�jj|�}|tk	r"|S�j|jkr8dSx<�jj�D]+}t|t�r`qHt||�rHdSqHWtS)NT)�	__extra__�__subclasshook__r|r��__subclasses__rjrr�)�subclass�res�scls)rVrCrD�
__extrahook__�sz)_make_subclasshook.<locals>.__extrahook__cs#�jrt|�j�rdStS)NT)r�r�r|)r�)rVrCrDr��s)rjr��abc�ABCMeta)rVr�rC)rVrD�_make_subclasshookysr�cCsAt|�}d|kr=x"|dD]}|j|d�q#W|S)Nro)�dict�pop)�dctZ	dict_copyZslotrCrCrD�_no_slots_copy�s
r�cs3eZdZddddd�fdd�Zedd��Zejdd��Zedd��Zejd	d��Zd
d�Zdd
�Z	�fdd�Z
�fdd�Zdddd�Zdd�Z
dd�Zedd��Z�fdd�Zdd�Zdd�Z�fd d!�Z�S)"rNc	s|dk	rnt|�}d}	xe|D]]}
|
tkrFtd��t|
t�r(|
jtkr(|	dk	r|td��|
j}	q(W|	dkr�|}	nrt|�}t|	��|�ks
tddj�fdd�|D��djdd�|	D��f��|	}|}|dk	rPt	|�t
jkrP||krP|f|}tdd�|D��}t
d	d�|D��r�td
d�|D��}|jd|d|i�t�j||||d
d�}
||
_|r�tdd�|D��nd|
_t|
�|
_|dkr*||
_d|kr<|sWt|
jdd�dkrft|
�|
_t|t
j�r�|j|
_|j|
_n$|dk	r�|j|
_|j|
_|r�t|d�r�|j|
_|r�t|
j��ntt|
�j�|
_|
S)Nz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.z6Some type variables (%s) are not listed in Generic[%s]z, c3s'|]}|�krt|�VqdS)N)rk)r�r�)�gvarsetrCrDr��sz&GenericMeta.__new__.<locals>.<genexpr>css|]}t|�VqdS)N)rk)r��grCrCrDr��scss0|]&}t|t�r$t|�n|VqdS)N)rjrr�)r�r�rCrCrDr��scss*|] }t|t�o!|tk	VqdS)N)rjrr
)r�r�rCrCrDr��scss!|]}|tk	r|VqdS)N)r
)r�r�rCrCrDr��sr�r�rOTcss9|]/}|tkrdn|tkr-fn|VqdS).N)�_TypingEllipsis�_TypingEmpty)r�r�rCrCrDr��sr�rA�r�r@) r�r
rPrjrr�r�r�rQrmr�r�rlr��updaterTrUr�r��__next_in_mro__�__orig_bases__r�r�r��
_abc_registry�
_abc_cacher�r@rr�r�r�)rVrWrXrYrbr\r��extra�
orig_basesZgvars�baseZtvarsetZ
initial_basesr[)rZ)r�rDrU�sd
	
	#-
!	(	zGenericMeta.__new__cCs,t|jtj�r|jjSt|�jS)N)rjr�r�r��_abc_negative_cacher��_abc_generic_negative_cache)r[rCrCrDr�s
zGenericMeta._abc_negative_cachecCs@|jdkr<t|jtj�r3||j_n	||_dS)N)r�rjr�r�r�r�r�)r[�valuerCrCrDr�scCs,t|jtj�r|jjSt|�jS)N)rjr�r�r��_abc_negative_cache_versionr��#_abc_generic_negative_cache_version)r[rCrCrDr�s
z'GenericMeta._abc_negative_cache_versioncCs@|jdkr<t|jtj�r3||j_n	||_dS)N)r�rjr�r�r�r�r�)r[r�rCrCrDr�$scCs&|jr"|jr"t|j|�dS)N)r�r�rc)r[rbrCrCrDrc,szGenericMeta._get_type_varscs�|jr|jj���nd}|jrRt��fdd�|jD��nd}||jkrz||jkrz|S|j|j|jt|j�d|r�t	|�ndd|d|d|j
d|j�S)Nc3s!|]}t|���VqdS)N)ra)r�r�)r_r`rCrDr�3sz)GenericMeta._eval_type.<locals>.<genexpr>rbr\r�r�r�)r�rar�rlrZrA�	__bases__r��__dict__r�r�r�)r[r_r`r�r�rC)r_r`rDra0s$4	zGenericMeta._eval_typecs/|jdkrt�j�S|j|j��S)N)r�rTrfr�r�)r[)rZrCrDrf@s
zGenericMeta.__repr__cs�g}xs|dd�D]a}|fkr9|jd�qt|t�s^|jt|��q|j|dj|��qWt�j�ddj|�S)NrKz()rz[%s]z, )r�rjrlrSr�rTrfrQ)r[r�r�ry)rZrCrDr�EszGenericMeta._tree_reprcCs<|jdkr|St|||�}t|�ft|�S)N)r�r�r�rl)r[rbr\r�rCrCrDr�PszGenericMeta._subs_treecCsKt|t�stS|jdks1|jdkr;||kS|j|jkS)N)rjrr|r�r�)r[r}rCrCrDr~Vs

zGenericMeta.__eq__cCs|jS)N)r�)r[rCrCrDr�]szGenericMeta.__hash__cs�t|t�s|f}|rGt|�tk	rGtdt|���d�t�fdd�|D��}|tkr�tdd�|D��s�td��tt	|��t|�kr�td��|}|}n�|tt
fkr�t|�}|}nh|tkr|}|}nM|j
ttfkrFtdt|���nt||�t|�}|}|j
dkr}|fnf}|j|j||jt|j�d	|d
|d|d|jd
|j�S)Nz)Parameter list to %s[...] cannot be emptyz*Parameters to generic types must be types.c3s|]}t|��VqdS)N)r{)r�r�)r�rCrDr�hsz*GenericMeta.__getitem__.<locals>.<genexpr>css|]}t|t�VqdS)N)rjr)r�r�rCrCrDr�ksz5Parameters to Generic[...] must all be type variablesz-Parameters to Generic[...] must all be uniquez'Cannot subscript already-subscripted %srbr\r�r�r�)rjrlr�rrPrEr
�allrir�rr�r�r�r�r�rZrAr�r�rr�r�)r[r�rbr\ZprependrC)r�rDr�`sJ						

	zGenericMeta.__getitem__csg|jdk	r;tjd�jddkr7td��dS|tkrWtd|��t�j|�S)	NrKrAr�r�zCParameterized generics cannot be used with class or instance checksFz5Class %r cannot be used with class or instance checks)r�r�)r�r>�	_getframe�	f_globalsrPr
rTr�)r[rV)rZrCrDr��s
zGenericMeta.__subclasscheck__cCst|j|�S)N)r�rZ)r[r�rCrCrDr��szGenericMeta.__instancecheck__c	Cs@|j|j|jt|j�|j|j|j|j|j	�S)N)
rZrAr�r�rr�r�r�r�r�)r[rCrCrD�__copy__�szGenericMeta.__copy__csl|jd�r|jd�s-|jd�rItt|�j||�nttt|��j||�dS)N�__�_abc_)rL�endswithrTr�__setattr__r�)r[�attrr�)rZrCrDr�szGenericMeta.__setattr__)rArdr@rU�propertyr��setterr�rcrarfr�r�r~r�r�r�r�r�rrrCrC)rZrDr�s"!^.cOsq|jdkr|j|�St|�}|j|�}y
||_Wntk
rXYnX|j||�|SdS)N)r�rUr�Z__orig_class__�AttributeErrorr^)Zbase_clsrVr\r]r�r�rCrCrD�_generic_new�s


r
c@s"eZdZfZdd�ZdS)r
cOs1t|t�rtd��t|j|||�S)NzHType Generic cannot be instantiated; it can be used only as a base class)r�r
rPr
r�)rVr\r]rCrCrDrU�szGeneric.__new__N)rArdr@rorUrCrCrCrDr
�sc@seZdZdS)r�N)rArdr@rCrCrCrDr��sr�c@seZdZdS)r�N)rArdr@rCrCrCrDr��sr�cs@eZdZe�fdd��Zdd�Zdd�Z�S)�	TupleMetacs�|jdk	st|t�r/t�j|�S|fkrNt�jtf�St|t�sf|f}t|�dkr�|ddkr�d�t	|d��}t�j|t
f�Sd�t�fdd�|D��}t�j|�S)	NrrK.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3s|]}t|��VqdS)N)r{)r�r�)r�rCrDr�sz(TupleMeta.__getitem__.<locals>.<genexpr>)r�r�rrTr�r�rjrlrir{r�)r[r�r�)rZ)r�rDr��s	"zTupleMeta.__getitem__cCs,|jdkrt|t�Std��dS)Nz5Parameterized Tuple cannot be used with isinstance().)r�rjrlrP)r[r�rCrCrDr�s
zTupleMeta.__instancecheck__cCs,|jdkrt|t�Std��dS)Nz5Parameterized Tuple cannot be used with issubclass().)r�r�rlrP)r[rVrCrCrDr�
s
zTupleMeta.__subclasscheck__)rArdr@r�r�r�r�rCrC)rZrDr�src@s"eZdZfZdd�ZdS)rcOs.t|t�rtd��tt|||�S)Nz6Type Tuple cannot be instantiated; use tuple() instead)r�rrPr
rl)rVr\r]rCrCrDrUsz
Tuple.__new__N)rArdr@rorUrCrCrCrDrs
r�cs^eZdZ�fdd�Z�fdd�Z�fdd�Ze�fdd��Z�S)	�CallableMetacs/|jdkrt�j�S|j|j��S)N)r�rTrfr�r�)r[)rZrCrDrf's
zCallableMeta.__repr__cs�t|�tk	r"t�j|�Sg}xW|dd�D]E}t|t�sd|jt|��q9|j|dj|��q9W|ddkr�t|d�d|dSt|d�ddj	|dd��|dfS)	NrKrz...z	[..., %s]z
[[%s], %s]z, r�r�)
r�rrTr�rjrlr�rSr�rQ)r[r�r�ry)rZrCrDr�,s
zCallableMeta._tree_reprcs�|jdk	st|t�r/t�j|�St|t�sQt|�dkr]td��|\}}|t	kr�t	|f}n4t|t
�s�td|f��t|�|f}|j|�S)Nrz6Callable must be used as Callable[[arg, ...], result].z8Callable[args, result]: args must be a list. Got %.100r.)r�r�rrTr�rjrlrirP�Ellipsis�list�__getitem_inner__)r[r�r\�result)rZrCrDr�<s"
zCallableMeta.__getitem__cs�|\}}d�t|��}|tkrCt�jt|f�Sd�t�fdd�|D��}||f}t�j|�S)Nz.Callable[args, result]: result must be a type.z6Callable[[arg, ...], result]: each arg must be a type.c3s|]}t|��VqdS)N)r{)r�ry)r�rCrDr�Xsz1CallableMeta.__getitem_inner__.<locals>.<genexpr>)r{rrTr�r�rl)r[r�r\r)rZ)r�rDrPs
zCallableMeta.__getitem_inner__)rArdr@rfr�r�r�rrCrC)rZrDr$src@s"eZdZfZdd�ZdS)rcOs1t|t�rtd��t|j|||�S)NzIType Callable cannot be instantiated; use a non-abstract subclass instead)r�rrPr
r�)rVr\r]rCrCrDrUjszCallable.__new__N)rArdr@rorUrCrCrCrDr]scsgeZdZdZddd�Zdd�Zdd�Z�fd	d
�Zdd�Zd
d�Z	�S)r��__type__NcKs
||_dS)N)r)r[�tpr]rCrCrDr^�sz_ClassVar.__init__cCspt|�}|jdkrJ|t|dj|jdd���dd�Stdj|jdd����dS)Nz{} accepts only single type.rKrOTz {} cannot be further subscripted)rmrr{�formatrArP)r[�itemrVrCrCrDr��s		z_ClassVar.__getitem__cCs>t|j||�}||jkr(|St|�|dd�S)NrOT)rarrm)r[r_r`Znew_tprCrCrDra�sz_ClassVar._eval_typecs>t�j�}|jdk	r:|djt|j��7}|S)Nz[{}])rTrfrrrS)r[�r)rZrCrDrf�sz_ClassVar.__repr__cCstt|�j|jf�S)N)rrmrAr)r[rCrCrDr��sz_ClassVar.__hash__cCs<t|t�stS|jdk	r2|j|jkS||kS)N)rjr�r|r)r[r}rCrCrDr~�s
z_ClassVar.__eq__)r)
rArdr@ror^r�rarfr�r~rCrC)rZrDr�qs	r�cCs|S)NrC)�typ�valrCrCrDr6�sc
Cs�y
|j}Wntk
r%iSYnX|j}|j}|d|�}|jpTf}|j}|rrt|�ni}|t|�}x1t||d�|�D]\}}	|	||<q�W|S)N)	�__code__r�co_argcount�co_varnames�__defaults__�__kwdefaults__r�ri�zip)
r�rzZ	pos_countZ	arg_names�defaultsZ
kwdefaultsr�Z
pos_offsetrWr�rCrCrD�
_get_defaults�s

				&r"c	Cst|dd�riS|dkrIt|di�}|dkr[|}n|dkr[|}t|t�ri}x�t|j�D]�}|jjdi�}xi|j�D][\}}|dkr�td�}t|t�r�t	|�}t
|||�}|||<q�Wq�W|St|dd�}|dkrUt|t�r@iStdj
|���t|�}t|�}x�|j�D]�\}}|dkr�td�}t|t�r�t	|�}t
|||�}||kr�||dkr�t|}|||<qzW|S)N�__no_type_check__�__globals__�__annotations__z1{!r} is not a module, class, method, or function.)r�rjrm�reversedr�r�get�itemsrkrGra�_allowed_typesrPrr"r�r)	r�r_r`Zhintsr�ZannrWr�r!rCrCrDr7�sL		
cCs�t|t�r�|jj�}x9|jj�D](\}}||jkr.|j|�q.WxH|j�D]:}t|tj	�r�d|_
t|t�rgt|�qgWy
d|_
Wntk
r�YnX|S)NT)
rjrmr�copyr(r�r��valuesr�r�r#r9rP)ryZ	arg_attrsr	rr�rCrCrDr9s		

cs%tj���fdd��}|S)Ncs�||�}t|�}|S)N)r9)r\r]r�)�	decoratorrCrD�wrapped_decorator8sz2no_type_check_decorator.<locals>.wrapped_decorator)r�r�)r,r-rC)r,rDr:1s!cOstd��dS)Nz�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.)�NotImplementedError)r\r]rCrCrD�_overload_dummyAsr/cCstS)N)r/)r�rCrCrDr;Jscs:eZdZ�fdd�Zdd�Zdd�Z�S)�
_ProtocolMetacs/t|jkrt�j|�Std��dS)Nz+Protocols cannot be used with isinstance().)r�r�rTr�rP)r[r�)rZrCrDr�nsz_ProtocolMeta.__instancecheck__csd|js
tS|tkrdS|j�}x4|D],�t�fdd�|jD��s0dSq0WdS)NTc3s|]}�|jkVqdS)N)r)r��d)r	rCrDr��sz2_ProtocolMeta.__subclasscheck__.<locals>.<genexpr>F)rgr|r��_get_protocol_attrsr�r�)r[rV�attrsrC)r	rDr�ss	
"z_ProtocolMeta.__subclasscheck__cCs�g}x?|jD]4}t|dd�r|jdkr|j|�qWt�}x<|D]4}x+|jj�D]}x|jD]5}||k	r~||jkr~t|dd�r~Pq~W|jd�rn|dkrn|dkrn|dkrn|dkrn|dkrn|d	krn|d
krn|dkrn|dkrn|d
krn|dkrn|dkrn|dkrn|dkrn|dkrn|j|�qnWqXW|S)NrgFr�r�__abstractmethods__r%rhrr�ror2r�r�r�r�r�r�rd)	r�r�rAr�r�r�keysrL�add)r[Zprotocol_basesr�r3r�r	rCrCrDr2�s:!	
z!_ProtocolMeta._get_protocol_attrs)rArdr@r�r�r2rCrC)rZrDr0gsr0c@seZdZfZdZdS)r�TN)rArdr@rorgrCrCrCrDr��sr��	Awaitablec@seZdZfZdS)r7N)rArdr@rorCrCrCrDr7�s�	Coroutinec@seZdZfZdS)r8N)rArdr@rorCrCrCrDr8�s�
AsyncIterablec@seZdZfZdS)r9N)rArdr@rorCrCrCrDr9�sc@seZdZfZdS)�
AsyncIteratorN)rArdr@rorCrCrCrDr:�sr:c@seZdZfZdS)rN)rArdr@rorCrCrCrDr�sc@seZdZfZdS)rN)rArdr@rorCrCrCrDr�sc@s1eZdZfZeeddd���ZdS)r*)�returncCsdS)NrC)r[rCrCrD�__int__�szSupportsInt.__int__N)rArdr@ror�intr<rCrCrCrDr*�sc@s1eZdZfZeeddd���ZdS)r))r;cCsdS)NrC)r[rCrCrD�	__float__�szSupportsFloat.__float__N)rArdr@ror�floatr>rCrCrCrDr)�sc@s1eZdZfZeeddd���ZdS)r()r;cCsdS)NrC)r[rCrCrD�__complex__�szSupportsComplex.__complex__N)rArdr@ror�complexr@rCrCrCrDr(�sc@s1eZdZfZeeddd���ZdS)r')r;cCsdS)NrC)r[rCrCrD�	__bytes__�szSupportsBytes.__bytes__N)rArdr@ror�bytesrBrCrCrCrDr'�sc@s1eZdZfZeeddd���ZdS)r&)r;cCsdS)NrC)r[rCrCrD�__abs__szSupportsAbs.__abs__N)rArdr@rorr�rDrCrCrCrDr&sc@s7eZdZfZedeeddd���ZdS)r+r)�ndigitsr;cCsdS)NrC)r[rErCrCrD�	__round__szSupportsRound.__round__N)rArdr@rorr=r�rFrCrCrCrDr+	sc@seZdZfZdS)r%N)rArdr@rorCrCrCrDr%sc@s1eZdZfZedddd���ZdS)r%zIterator[T_co])r;cCsdS)NrC)r[rCrCrD�__reversed__szReversible.__reversed__N)rArdr@rorrGrCrCrCrDr%sc@seZdZfZdS)rN)rArdr@rorCrCrCrDr s�
Collectionc@seZdZfZdS)rHN)rArdr@rorCrCrCrDrH%sc@seZdZfZdS)rN)rArdr@rorCrCrCrDr/sc@seZdZfZdS)rN)rArdr@rorCrCrCrDr3sc@seZdZfZdS)r!N)rArdr@rorCrCrCrDr!8sc@seZdZfZdS)rN)rArdr@rorCrCrCrDr>sc@seZdZfZdS)rN)rArdr@rorCrCrCrDrBsc@seZdZfZdS)rN)rArdr@rorCrCrCrDrGsc@seZdZfZdS)r"N)rArdr@rorCrCrCrDr"Msc@seZdZfZdS)r"N)rArdr@rorCrCrCrDr"Qsc@seZdZfZdS)r"N)rArdr@rorCrCrCrDr"Usc@seZdZfZdS)r N)rArdr@rorCrCrCrDr Zsc@seZdZfZdS)rN)rArdr@rorCrCrCrDr^sc@s"eZdZfZdd�ZdS)r0cOs.t|t�rtd��tt|||�S)Nz4Type List cannot be instantiated; use list() instead)r�r0rPr
r)rVr\r]rCrCrDrUfszList.__new__N)rArdr@rorUrCrCrCrDr0bsc@s"eZdZfZdd�ZdS)r-cOs5t|t�rtj||�Sttj|||�S)N)r�r-�collections�dequer
)rVr\r]rCrCrDrUqsz
Deque.__new__N)rArdr@rorUrCrCrCrDr-msc@s"eZdZfZdd�ZdS)r1cOs.t|t�rtd��tt|||�S)Nz2Type Set cannot be instantiated; use set() instead)r�r1rPr
r�)rVr\r]rCrCrDrU{szSet.__new__N)rArdr@rorUrCrCrCrDr1wsc@s"eZdZfZdd�ZdS)r2cOs.t|t�rtd��tt|||�S)Nz>Type FrozenSet cannot be instantiated; use frozenset() instead)r�r2rPr
r�)rVr\r]rCrCrDrU�szFrozenSet.__new__N)rArdr@rorUrCrCrCrDr2�sc@seZdZfZdS)rN)rArdr@rorCrCrCrDr�sc@seZdZfZdS)rN)rArdr@rorCrCrCrDr�sc@seZdZfZdS)rN)rArdr@rorCrCrCrDr�sc@seZdZfZdS)r$N)rArdr@rorCrCrCrDr$�s�AbstractContextManagerc@seZdZfZdS)rN)rArdr@rorCrCrCrDr�sc@sIeZdZfZdd�Zejdd��Zedd��Z	dS)rcCs|S)NrC)r[rCrCrD�	__enter__�szContextManager.__enter__cCsdS)NrC)r[�exc_type�	exc_value�	tracebackrCrCrD�__exit__�szContextManager.__exit__cCsL|tkrHtdd�|jD��rHtdd�|jD��rHdStS)Ncss|]}d|jkVqdS)rLN)r)r��BrCrCrDr��sz2ContextManager.__subclasshook__.<locals>.<genexpr>css|]}d|jkVqdS)rPN)r)r�rQrCrCrDr��sT)rr�r�r|)rV�CrCrCrDr��s
zContextManager.__subclasshook__N)
rArdr@rorLr�rrP�classmethodr�rCrCrCrDr�s�AbstractAsyncContextManagerc@seZdZfZdS)�AsyncContextManagerN)rArdr@rorCrCrCrDrU�srU�a�
class AsyncContextManager(Generic[T_co]):
    __slots__ = ()

    async def __aenter__(self):
        return self

    @abc.abstractmethod
    async def __aexit__(self, exc_type, exc_value, traceback):
        return None

    @classmethod
    def __subclasshook__(cls, C):
        if cls is AsyncContextManager:
            if sys.version_info[:2] >= (3, 6):
                return _collections_abc._check_methods(C, "__aenter__", "__aexit__")
            if (any("__aenter__" in B.__dict__ for B in C.__mro__) and
                    any("__aexit__" in B.__dict__ for B in C.__mro__)):
                return True
        return NotImplemented

__all__.append('AsyncContextManager')
c@s"eZdZfZdd�ZdS)r.cOs.t|t�rtd��tt|||�S)Nz4Type Dict cannot be instantiated; use dict() instead)r�r.rPr
r�)rVr\r]rCrCrDrU�szDict.__new__N)rArdr@rorUrCrCrCrDr.�sc@s"eZdZfZdd�ZdS)r/cOs5t|t�rtj||�Sttj|||�S)N)r�r/rI�defaultdictr
)rVr\r]rCrCrDrU�szDefaultDict.__new__N)rArdr@rorUrCrCrCrDr/�sc@s"eZdZfZdd�ZdS)r,cOs5t|t�rtj||�Sttj|||�S)N)r�r,rIr
)rVr\r]rCrCrDrU�szCounter.__new__N)rArdr@rorUrCrCrCrDr,�s�ChainMapc@s"eZdZfZdd�ZdS)rXcOs5t|t�rtj||�Sttj|||�S)N)r�rXrIr
)rVr\r]rCrCrDrUszChainMap.__new__N)rArdr@rorUrCrCrCrDrXsc@s"eZdZfZdd�ZdS)r4cOs.t|t�rtd��tt|||�S)Nz@Type Generator cannot be instantiated; create a subclass instead)r�r4rPr
�_G_base)rVr\r]rCrCrDrUszGenerator.__new__N)rArdr@rorUrCrCrCrDr4s�AsyncGeneratorc@seZdZfZdS)rZN)rArdr@rorCrCrCrDrZ s�CT_cor�c@seZdZfZdS)rN)rArdr@rorCrCrCrDr,scs�d��fdd�|D�}tj|dd�|D��}tj|�|_|_y%tjd�jjdd�|_	Wnt
tfk
r�YnX|S)NzDNamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a typecs+g|]!\}}|t|��f�qSrC)r{)r��nr�)r�rCrD�
<listcomp>Is	z!_make_nmtuple.<locals>.<listcomp>cSsg|]\}}|�qSrCrC)r�r\r�rCrCrDr]Js	rrA�__main__)rI�
namedtuple�OrderedDictr%�_field_typesr>rrr'rdrr�)rWr��nm_tplrC)r�rD�
_make_nmtupleGs%rcrUr^ro�__getnewargs__�_fields�_field_defaultsra�_make�_replace�_asdict�_sourcerdrAr@r%cs"eZdZ�fdd�Z�S)�NamedTupleMetacsb|jdd�r+t�j||||�Sts=td��|jdi�}t||j��}g}i}xq|D]i}||kr�||}	|j|	�|	||<qw|rwtdjd|ddj	|j
�����qwWt|�|j_||_
x\|D]T}
|
tkr+td	|
��q|
tkr|
|jkrt||
||
�qW|S)
NrOFz<Class syntax for NamedTuple is only supported in Python 3.6+r%zXNon-default namedtuple field {field_name} cannot follow default field(s) {default_names}�
field_nameZ
default_namesz, z&Cannot overwrite NamedTuple attribute )r'rTrU�_PY36rPrcr(r�rrQr5rlrrf�_prohibitedr�_specialre�setattr)rV�typenamerX�nsr�rbr!Z
defaults_dictrlZ
default_value�key)rZrCrDrUas2



	
zNamedTupleMeta.__new__)rArdr@rUrCrC)rZrDrk_srkc@s%eZdZdZddd�ZdS)r3TNcKsS|rtrtd��|dkr4|j�}n|rFtd��t||�S)Nz>Keyword syntax for NamedTuple is only supported in Python 3.6+zIEither list of fields or keywords can be provided to NamedTuple, not both)rmrPr(rc)r[rqZfields�kwargsrCrCrDrU�s
zNamedTuple.__new__)rArdr@rOrUrCrCrCrDr3�scCs"dd�}||_||_|S)NcSs|S)NrC)rBrCrCrD�new_type�szNewType.<locals>.new_type)rAZ
__supertype__)rWrrurCrCrDr8�s		Fc@saeZdZfZeeddd���Zeeddd���Zedddd���Z	ee
dd	d
���Zeeddd���Z
eddd
d���Zee
ddd���Zed5eeddd���Zee
ddd���Zed6eeddd���Zed7eeeddd���Zedeeeddd ���Zee
dd!d"���Zeedd#d$���Zedeed%d&d'���Zee
dd(d)���Zeeed*d+d,���Zeeedd-d.d/���Zed0dd1d2���Zeddd3d4���ZdS)8�IO)r;cCsdS)NrC)r[rCrCrD�mode�szIO.modecCsdS)NrC)r[rCrCrDrW�szIO.nameNcCsdS)NrC)r[rCrCrD�close�szIO.closecCsdS)NrC)r[rCrCrD�closed�sz	IO.closedcCsdS)NrC)r[rCrCrD�fileno�sz	IO.filenocCsdS)NrC)r[rCrCrD�flush�szIO.flushcCsdS)NrC)r[rCrCrD�isatty�sz	IO.isattyrK)r\r;cCsdS)NrC)r[r\rCrCrD�read�szIO.readcCsdS)NrC)r[rCrCrD�readable�szIO.readable)�limitr;cCsdS)NrC)r[rrCrCrD�readline�szIO.readline)�hintr;cCsdS)NrC)r[r�rCrCrD�	readlines	szIO.readlinesr)�offset�whencer;cCsdS)NrC)r[r�r�rCrCrD�seek	szIO.seekcCsdS)NrC)r[rCrCrD�seekable
	szIO.seekablecCsdS)NrC)r[rCrCrD�tell	szIO.tell)�sizer;cCsdS)NrC)r[r�rCrCrD�truncate	szIO.truncatecCsdS)NrC)r[rCrCrD�writable	szIO.writable)�sr;cCsdS)NrC)r[r�rCrCrD�write	szIO.write)�linesr;cCsdS)NrC)r[r�rCrCrD�
writelines	sz
IO.writelinesz
IO[AnyStr]cCsdS)NrC)r[rCrCrDrL"	szIO.__enter__cCsdS)NrC)r[rmr�rOrCrCrDrP&	szIO.__exit__r�r�r�)rArdr@rorrkrwrWrrxr�ryr=rzr{r|r5r}r~r�r0r�r�r�r�r�r�r�r�rLrPrCrCrCrDrv�sR
"!rvc@sYeZdZfZeeeefeddd���Z	edddd���Z
dS)�BinaryIO)r�r;cCsdS)NrC)r[r�rCrCrDr�0	szBinaryIO.write)r;cCsdS)NrC)r[rCrCrDrL4	szBinaryIO.__enter__N)rArdr@rorrrC�	bytearrayr=r�rLrCrCrCrDr�+	s
%r�c@s�eZdZfZeeddd���Zeeddd���Zee	eddd���Z
eeddd	���Zee
dd
d���Zedddd
���ZdS)�TextIO)r;cCsdS)NrC)r[rCrCrD�buffer>	sz
TextIO.buffercCsdS)NrC)r[rCrCrD�encodingB	szTextIO.encodingcCsdS)NrC)r[rCrCrD�errorsF	sz
TextIO.errorscCsdS)NrC)r[rCrCrD�line_bufferingJ	szTextIO.line_bufferingcCsdS)NrC)r[rCrCrD�newlinesN	szTextIO.newlinescCsdS)NrC)r[rCrCrDrLR	szTextIO.__enter__N)rArdr@rorr�r�rkr�rr�r�r�r
r�rrLrCrCrCrDr�9	sr�c@s1eZdZdddgZeZeZeZdS)�iorvr�r�N)rArdr@�__all__rvr�r�rCrCrCrDr�W	sr�z.io�Patternr�cCs|jS)N)�pattern)r�rCrCrD�<lambda>e	sr��MatchcCs
|jjS)N)�rer�)�mrCrCrDr�g	sc@s(eZdZddgZeZeZdS)r�r�r�N)rArdr@r�r�r�rCrCrCrDr�j	sr�z.re)�r�rrrI�
contextlibr�r�Z	stdlib_rer>r��collections.abcZcollections_abc�ImportErrorr?�_collections_abcrrr	rmr�r^�__str__rkrQr�rErMrNrHrIrGrFrcr�rar{rSr�r
r�ZNoReturnrr�r�r�r�r�r�r�rCr5r�r�r�r�r�r�r�rr�rr�r�r�r�r�r�rr
r
r�r�rrlrrrr�rr6r"r��BuiltinFunctionType�
MethodType�
ModuleTyper)r7r9r:r/r;r0r�rr�r7r�r8r9r:rrr*r)r(r'r&r+r%r#rrHr1rr!rrr"r r=rrr0rJr-r�r�r2rrrr$rKrrTrU�execr�r.rWr/r,rXr4rY�
GeneratorTyperZr[rrcrmrnrorkr3r8r<r=rvr�r�r�rA�modulesrwr��matchr�rCrCrCrD�<module>s�
 
	*%5CW!)��""9"6I	C	#
'
#

##&	#!
!#$.)!!###)
##
&#&)#
/

#	'	
$
 	!(`	



?>