U
    [e                     @   s0   d Z ddlmZmZ dd Zdd Zdd Zd	S )
z
Python introspection helpers.
    )CodeTypeFunctionTypec                    sh   ddddddddd	d
ddddg}t tdr6|dd t tdrL|dd  fdd|D }t| S )NZargcountZnlocalsZ	stacksizeflagscodeZconstsnamesvarnamesfilenamenameZfirstlinenoZlnotabZfreevarsZcellvarsco_kwonlyargcount   Zkwonlyargcountco_posonlyargcountZposonlyargcountc              	      s"   g | ]}  |td | qS )Zco_getgetattr.0r	   changestemplate X/var/www/html/services/stratfitenv/lib/python3.8/site-packages/automat/_introspection.py
<listcomp>   s   zcopycode.<locals>.<listcomp>)hasattrr   insert)r   r   r   valuesr   r   r   copycode   s.               

r   c                    s6   ddddg} fdd|D }t tj|f| S )Nglobalsr	   defaultsclosurec              	      s&   g | ]}  |td | d  qS )__r   r   funcchangesr   r   r   r      s   z copyfunction.<locals>.<listcomp>)functionr   __code__)r   r!   Zcodechangesr   r   r   r    r   copyfunction   s       r$   c                    s    fdd}|S )zL
    Preserve the name of the given function on the decorated function.
    c                    s   t | t jdt jdS )N)r	   )r$   dict__name__)Z	decoratedfr   r   	decorator*   s    
 
zpreserveName.<locals>.decoratorr   )r(   r)   r   r'   r   preserveName&   s    r*   N)	__doc__typesr   r   r   r"   r   r$   r*   r   r   r   r   <module>   s   