o
    >h                     @   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                    sx   t tdrjdi dd   D S g d}t tdr#|dd t tdr.|dd	  fd
d|D }t| S )Nreplacec                 S   s   i | ]	\}}d | |qS co_ ).0kvr   r   v/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/automat/_introspection.py
<dictcomp>
   s    zcopycode.<locals>.<dictcomp>)argcountnlocals	stacksizeflagscodeconstsnamesvarnamesfilenamenamefirstlinenolnotabfreevarscellvarsco_kwonlyargcount   kwonlyargcountco_posonlyargcountposonlyargcountc              	      s"   g | ]}  |td | qS r   getgetattrr   r   changestemplater   r   
<listcomp>    s   " zcopycode.<locals>.<listcomp>r   )hasattrr   r   itemsinsert)r&   r%   r   valuesr   r$   r   copycode   s   


r,   c                    s4   g d} fdd|D }t tj|g|R  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&   r2   codechangesr   r+   r   r1   r   copyfunction$   s
   r6   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   )r6   dict__name__)	decoratedfr   r   	decorator6   s   zpreserveName.<locals>.decoratorr   )r;   r<   r   r:   r   preserveName1   s   r=   N)	__doc__typesr   r   r   r3   r,   r6   r=   r   r   r   r   <module>   s
    