
     h	                    ^    S r SSKJr  SSKJr  SSKJr  SSKJr      S
S jr	SS jr
SS jrg	)z"Determine contexts for coverage.py    )annotations)Sequence)	FrameType)TShouldStartContextFnc                P   ^  T (       d  g[        T 5      S:X  a  T S   $ SU 4S jjnU$ )a  Create a single context switcher from multiple switchers.

`context_switchers` is a list of functions that take a frame as an
argument and return a string to use as the new context label.

Returns a function that composites `context_switchers` functions, or None
if `context_switchers` is an empty list.

When invoked, the combined switcher calls `context_switchers` one-by-one
until a string is returned.  The combined switcher returns None if all
`context_switchers` return None.
N   r   c                6   > T H  nU" U 5      nUc  M  Us  $    g)z,The combiner for multiple context switchers.N )frameswitchernew_contextcontext_switcherss      n/root/racknerd_01/codex-conversation/amazon-q-terraform/.venv/lib/python3.13/site-packages/coverage/context.pyshould_start_context7combine_context_switchers.<locals>.should_start_context#   s'    )H"5/K&"" *     r   r   returnz
str | None)len)r   r   s   ` r   combine_context_switchersr      s1     
" ##  r   c                ~    U R                   R                  nUR                  S5      (       d  US:X  a  [        U 5      $ g)z(Is this frame calling a test_* function?testrunTestN)f_codeco_name
startswithqualname_from_frame)r   r   s     r   "should_start_context_test_functionr   .   s7    ll""G&!!W	%9"5))r   c                   U R                   nUR                  nSnUR                  (       a;  UR                  S   S:X  a(  U R                  R                  SS5      n[        XBS5      nUc0  U R                  R                  U5      nUc  gUR                   SU 3$ [        USS5      nUc*  WR                  nUR                   SUR                   SU 3$ UR                   SUR                   3$ )z5Get a qualified name for the code running in `frame`.Nr   self.__func__)r   r   co_argcountco_varnamesf_localsgetgetattr	f_globals
__module__	__class____name____qualname__)r   cofnamemethodr    funcclss          r   r   r   6   s    	BJJEF	~~"..+v5~~!!&$/d+~""5)<//"!E7++6:t,D|nn..!3<<.%99ooa 1 1233r   N)r   zSequence[TShouldStartContextFn]r   zTShouldStartContextFn | Noner   )__doc__
__future__r   collections.abcr   typesr   coverage.typesr   r   r   r   r
   r   r   <module>r7      s6    ) " $  0 6 ! @4r   