
    Vh                     *    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          F/home/dcms/DCMS/lib/python3.12/site-packages/automat/_introspection.pycopycoder'      s    tYxMGMMO"LDAq519a<"LMME  t()Q()t)*Q)*MRSTgkk$%$, ?@SFS=/ #M, T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   $   sf    E RWIM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>.decorator6   s$    It'<d

>STT    r   )r7   r8   s   ` r&   preserveNamer:   1   s    
U r9   N)	__doc__typesr   r   r   r-   r'   r1   r:   r   r9   r&   <module>r=      s    =8
Gr9   