
    b_                     ,    d Z ddlmZmZ d Zd Zd ZdS )z
Python introspection helpers.
    )CodeTypeFunctionTypec                      g d}t          t          d          r|                    dd           t          t          d          r|                    dd            fd|D             }t          | S )N)argcountnlocals	stacksizeflagscodeconstsnamesvarnamesfilenamenamefirstlinenolnotabfreevarscellvarsco_kwonlyargcount   kwonlyargcountco_posonlyargcountposonlyargcountc           
      ^    g | ])}                     |t          d |z                       *S )co_getgetattr).0r   changestemplates     6lib/python3.11/site-packages/automat/_introspection.py
<listcomp>zcopycode.<locals>.<listcomp>   sE        	D'(EDL99::      )hasattrr
   insert)r    r   r   valuess   ``  r!   copycoder'      s      E
 t()) *Q()))t)** +Q)***      F =r#   c                 l     g d} fd|D             }t          t           j        |          g|R  S )N)globalsr   defaultsclosurec           
      d    g | ],}                     |t          d |z   d z                       -S )__r   )r   r   funcchangesr    s     r!   r"   z copyfunction.<locals>.<listcomp>   sJ        	ghtd0BCCDD  r#   )functionr'   __code__)r    r.   codechangesr   r&   s   ``   r!   copyfunctionr2      sg      E      F HX.<<FvFFFFr#   c                       fd}|S )zL
    Preserve the name of the given function on the decorated function.
    c                 r    t          | t          j                  t          j                            S )N)r   )r2   dict__name__)	decoratedfs    r!   	decoratorzpreserveName.<locals>.decorator*   s9    I aj1114QZ3H3H3HJ J 	Jr#    )r8   r9   s   ` r!   preserveNamer;   &   s)    J J J J J r#   N)	__doc__typesr   r
   r   r/   r'   r2   r;   r:   r#   r!   <module>r>      sc     = < < < < < < <  &G G G    r#   