
    ~bi                     *    d Z ddlmZmZ d Zd Zd Zy)z
Python introspection helpers.
    )CodeTypeFunctionTypec                    t        t        d      r7 | j                  d	i |j                         D ci c]  \  }}d|z   | c}}S g d}t        t        d      r|j	                  dd       t        t        d      r|j	                  dd       |D cg c]!  }|j                  |t        | d|z               # }}t        | S c c}}w c c}w )
Nreplaceco_)argcountnlocals	stacksizeflagscodeconstsnamesvarnamesfilenamenamefirstlinenolnotabfreevarscellvarsco_kwonlyargcount   kwonlyargcountco_posonlyargcountposonlyargcount )hasattrr   r   itemsinsertgetgetattr)templatechangeskvr   r   valuess          8/usr/lib/python3/dist-packages/automat/_introspection.pycopycoder'      s    tYxNW]]_"MTQ519q="MNNE
 t()Q()t)*Q)*  	D'(EDL9:F  = #Ns   C&C
c                     g d}|D cg c]$  }|j                  |t        | d|z   dz               & }}t        t        | j                  |      g| S c c}w )N)globalsr   defaultsclosure__)r   r    functionr'   __code__)r!   funcchangescodechangesr   r   r%   s         r&   copyfunctionr1      sg    E
  	ghtd0BCDF  HX..<FvFF	s   )Ac                       fd}|S )zL
    Preserve the name of the given function on the decorated function.
    c                 n    t        | t        j                        t        j                              S )N)r   )r1   dict__name__)	decoratedfs    r&   	decoratorzpreserveName.<locals>.decorator+   s+    I ajj14QZZ3HJ 	J    r   )r7   r8   s   ` r&   preserveNamer:   '   s    J r9   N)	__doc__typesr   r   r   r-   r'   r1   r:   r   r9   r&   <module>r=      s    =(Gr9   