HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/coverage/__pycache__/context.cpython-310.pyc
o

!we�	�@sVdZddlmZddlmZddlmZmZmZm	Z	dd	d
�Z
ddd�Zddd�ZdS)z"Determine contexts for coverage.py�)�annotations)�	FrameType)�cast�Callable�Optional�Sequence�context_switchers�.Sequence[Callable[[FrameType], Optional[str]]]�return�.Optional[Callable[[FrameType], Optional[str]]]cs.�sdSt��dkr�dSd
�fdd	�}|S)aCreate 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�framerr
�
Optional[str]cs&�D]}||�}|dur|SqdS)z,The combiner for multiple context switchers.N�)r
�switcher�new_context�rr�I/home/arjun/projects/env/lib/python3.10/site-packages/coverage/context.py�should_start_context!s�z7combine_context_switchers.<locals>.should_start_context�r
rr
r)�len)rrrrr�combine_context_switcherssrr
rrcCs&|jj}|�d�s
|dkrt|�SdS)z(Is this frame calling a test_* function?�test�runTestN)�f_code�co_name�
startswith�qualname_from_frame)r
rrrr�"should_start_context_test_function,srcCs�|j}|j}d}|jr|jddkr|j�dd�}t||d�}|dur9|j�|�}|dur/dStt	|j
d|�St|dd�}|durU|j}tt	|j
d|jd|�Stt	|j
d|j
�S)z5Get a qualified name for the code running in `frame`.Nr�self�.�__func__)rr�co_argcount�co_varnames�f_locals�get�getattr�	f_globalsr�str�
__module__�	__class__�__name__�__qualname__)r
�co�fname�methodr�func�clsrrrr4s rN)rr	r
rr)
�__doc__�
__future__r�typesr�typingrrrrrrrrrrr�<module>s