
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3

  \¦"  ã               @   s’  d Z ddlZdd„ ZeeƒZedd„ ƒZeejƒZeejƒZ	eej
ƒZdd„ Zeeƒ ƒZd	d
„ Zeƒ ZeeƒZejƒ  dd„ Zeƒ ZeeƒZG dd„ dƒZeeƒ jƒZeeƒZeg jƒZeeƒZye‚W n: ek
�r   ejƒ d ZeeƒZeejƒZ dZ[Y nX eejƒZ!eej"ƒZ#[[[[[f ddfdd„Z$f dfdd„Z%dd„ Z&G dd„ dƒZ'ddl(Z)ddl*j+Z,G dd„ dƒZ-dd„ Z.dd„ e/ƒ D ƒZ0dS )zO
Define names for built-in types that aren't directly accessible as a builtin.
é    Nc               C   s   d S )N© r   r   r   ú/usr/lib64/python3.6/types.pyÚ_f   s    r   c               C   s   d S )Nr   r   r   r   r   Ú<lambda>   s    r   c               c   s
   dV  d S )Né   r   r   r   r   r   Ú_g   s    r   c               Ã   s   d S )Nr   r   r   r   r   Ú_c   s    r   c               C  s
   d V  d S )Nr   r   r   r   r   Ú_ag   s    r	   c               @   s   e Zd Zdd„ ZdS )Ú_Cc             C   s   d S )Nr   )Úselfr   r   r   Ú_m!   s    z_C._mN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r
       s   r
   é   c             C   s2   t | ||ƒ\}}}|dk	r"||ƒ || ||f|ŽS )zBCreate a class object dynamically using the appropriate metaclass.N)Úprepare_class)ÚnameÚbasesÚkwdsÚ	exec_bodyÚmetaÚnsr   r   r   Ú	new_class9   s    r   c             C   s~   |dkri }nt |ƒ}d|kr*|jdƒ}n|r<t|d ƒ}nt}t|tƒrTt||ƒ}t|dƒrp|j| |f|Ž}ni }|||fS )az  Call the __prepare__ method of the appropriate metaclass.

    Returns (metaclass, namespace, kwds) as a 3-tuple

    *metaclass* is the appropriate metaclass
    *namespace* is the prepared class namespace
    *kwds* is an updated copy of the passed in kwds argument with any
    'metaclass' entry removed. If no kwds argument is passed in, this will
    be an empty dict.
    NÚ	metaclassr   Ú__prepare__)ÚdictÚpopÚtypeÚ
isinstanceÚ_calculate_metaÚhasattrr   )r   r   r   r   r   r   r   r   r   @   s    


r   c             C   sB   | }x8|D ]0}t |ƒ}t||ƒr"q
t||ƒr2|}q
tdƒ‚q
W |S )z%Calculate the most derived metaclass.zxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r   Ú
issubclassÚ	TypeError)r   r   ÚwinnerÚbaseÚ	base_metar   r   r   r   `   s    


r   c               @   sL   e Zd ZdZddd„Zddd„Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dS )ÚDynamicClassAttributea  Route attribute access on a class to __getattr__.

    This is a descriptor, used to define attributes that act differently when
    accessed through an instance and through a class.  Instance access remains
    normal, but access to an attribute through a class will be routed to the
    class's __getattr__ method; this is done by raising AttributeError.

    This allows one to have properties active on an instance, and have virtual
    attributes on the class with the same name (see Enum for an example).

    Nc             C   s>   || _ || _|| _|p|j| _|d k| _tt|ddƒƒ| _d S )NÚ__isabstractmethod__F)ÚfgetÚfsetÚfdelÚ__doc__Úoverwrite_docÚboolÚgetattrr'   )r   r(   r)   r*   Údocr   r   r   Ú__init__}   s    
zDynamicClassAttribute.__init__c             C   s6   |d kr| j r| S tƒ ‚n| jd kr,tdƒ‚| j|ƒS )Nzunreadable attribute)r'   ÚAttributeErrorr(   )r   ÚinstanceÚ
ownerclassr   r   r   Ú__get__‡   s    
zDynamicClassAttribute.__get__c             C   s"   | j d krtdƒ‚| j ||ƒ d S )Nzcan't set attribute)r)   r1   )r   r2   Úvaluer   r   r   Ú__set__�   s    
zDynamicClassAttribute.__set__c             C   s    | j d krtdƒ‚| j |ƒ d S )Nzcan't delete attribute)r*   r1   )r   r2   r   r   r   Ú
__delete__•   s    
z DynamicClassAttribute.__delete__c             C   s8   | j r|jnd }t| ƒ|| j| j|p(| jƒ}| j |_ |S )N)r,   r+   r   r)   r*   )r   r(   ÚfdocÚresultr   r   r   Úgetterš   s    zDynamicClassAttribute.getterc             C   s$   t | ƒ| j|| j| jƒ}| j|_|S )N)r   r(   r*   r+   r,   )r   r)   r9   r   r   r   Úsetter    s    zDynamicClassAttribute.setterc             C   s$   t | ƒ| j| j|| jƒ}| j|_|S )N)r   r(   r)   r+   r,   )r   r*   r9   r   r   r   Údeleter¥   s    zDynamicClassAttribute.deleter)NNNN)N)r   r   r   r+   r0   r4   r6   r7   r:   r;   r<   r   r   r   r   r&   q   s   


	r&   c               @   s€   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zed	d
„ ƒZedd„ ƒZ	edd„ ƒZ
edd„ ƒZeZe	Ze
ZeZdd„ Zdd„ ZeZdS )Ú_GeneratorWrapperc             C   s2   || _ |jtk| _t|dd ƒ| _t|dd ƒ| _d S )Nr   r   )Ú_GeneratorWrapper__wrappedÚ	__class__ÚGeneratorTypeÚ_GeneratorWrapper__isgenr.   r   r   )r   Úgenr   r   r   r0   °   s    z_GeneratorWrapper.__init__c             C   s   | j j|ƒS )N)r>   Úsend)r   Úvalr   r   r   rC   µ   s    z_GeneratorWrapper.sendc             G   s   | j j|f|žŽ S )N)r>   Úthrow)r   ÚtpÚrestr   r   r   rE   ·   s    z_GeneratorWrapper.throwc             C   s
   | j jƒ S )N)r>   Úclose)r   r   r   r   rH   ¹   s    z_GeneratorWrapper.closec             C   s   | j jS )N)r>   Úgi_code)r   r   r   r   rI   »   s    z_GeneratorWrapper.gi_codec             C   s   | j jS )N)r>   Úgi_frame)r   r   r   r   rJ   ¾   s    z_GeneratorWrapper.gi_framec             C   s   | j jS )N)r>   Ú
gi_running)r   r   r   r   rK   Á   s    z_GeneratorWrapper.gi_runningc             C   s   | j jS )N)r>   Úgi_yieldfrom)r   r   r   r   rL   Ä   s    z_GeneratorWrapper.gi_yieldfromc             C   s
   t | jƒS )N)Únextr>   )r   r   r   r   Ú__next__Ë   s    z_GeneratorWrapper.__next__c             C   s   | j r| jS | S )N)rA   r>   )r   r   r   r   Ú__iter__Í   s    z_GeneratorWrapper.__iter__N)r   r   r   r0   rC   rE   rH   ÚpropertyrI   rJ   rK   rL   Úcr_codeÚcr_frameÚ
cr_runningÚcr_awaitrN   rO   Ú	__await__r   r   r   r   r=   ®   s   r=   c                s´   t ˆ ƒstdƒ‚ˆ jtkrštˆ ddƒjtkršˆ jj}|d@ r@ˆ S |d@ ršˆ j}t|j|j	|j
|j|jdB |j|j|j|j|j|j|j|j|j|jƒˆ _ˆ S tjˆ ƒ‡ fdd„ƒ}|S )	z2Convert regular generator function to a coroutine.z$types.coroutine() expects a callableÚ__code__Ni€  é    é   c                 sT   ˆ | |Ž}|j tks*|j tkr.|jjd@ r.|S t|tjƒrPt|tjƒ rPt	|ƒS |S )NrX   )
r?   ÚCoroutineTyper@   rI   Úco_flagsr   Ú_collections_abcÚ	GeneratorÚ	Coroutiner=   )ÚargsÚkwargsÚcoro)Úfuncr   r   Úwrappedö   s    

zcoroutine.<locals>.wrapped)Úcallabler"   r?   ÚFunctionTyper.   ÚCodeTyperV   rZ   Úco_argcountÚco_kwonlyargcountÚ
co_nlocalsÚco_stacksizeÚco_codeÚ	co_constsÚco_namesÚco_varnamesÚco_filenameÚco_nameÚco_firstlinenoÚ	co_lnotabÚco_freevarsÚco_cellvarsÚ
_functoolsÚwraps)ra   rZ   Úcorb   r   )ra   r   Ú	coroutineÓ   s(    

rw   c             C   s    g | ]}|d d… dkr|‘qS )Nr   Ú_r   )Ú.0Únr   r   r   ú
<listcomp>
  s    r{   )1r+   Úsysr   r   rd   Ú
LambdaTyperV   re   Ú__dict__ÚMappingProxyTypeÚimplementationÚSimpleNamespacer   r@   r   rY   rH   r	   ÚAsyncGeneratorTyper
   r   Ú
MethodTypeÚlenÚBuiltinFunctionTypeÚappendÚBuiltinMethodTypeÚ
ModuleTyper"   Úexc_infoÚtbÚTracebackTypeÚtb_frameÚ	FrameTypeÚGetSetDescriptorTypeÚ__globals__ÚMemberDescriptorTyper   r   r   r&   Ú	functoolsrt   Úcollections.abcÚabcr[   r=   rw   ÚglobalsÚ__all__r   r   r   r   Ú<module>   sR   





 


 :
%7