L i XdZddlmZddlmZddlmZddlmZ d dZ d dZ d dZ y ) z"Determine contexts for coverage.py) annotations)Sequence) FrameType)TShouldStartContextFnc@sytdk(rdSdfd }|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. Nrc0D]}||}||cSy)z,The combiner for multiple context switchers.N)frameswitcher new_contextcontext_switcherss V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/coverage/context.pyshould_start_contextz7combine_context_switchers..should_start_context#s,) #H"5/K&"" #r rreturnz str | None)len)rrs` rcombine_context_switchersrs1  " ## rcr|jj}|jds|dk(r t|Sy)z(Is this frame calling a test_* function?testrunTestN)f_codeco_name startswithqualname_from_frame)r rs r"should_start_context_test_functionr.s4ll""G&!W %9"5)) rc|j}|j}d}|jr;|jddk(r)|jj dd}t ||d}|/|jj |}|y|jd|St |dd}|*j}|jd|jd|S|jd|jS)z5Get a qualified name for the code running in `frame`.Nrself.__func__) rr co_argcount co_varnamesf_localsgetgetattr f_globals __module__ __class____name__ __qualname__)r cofnamemethodrfuncclss rrr6s B JJE F ~~"..+v5~~!!&$/ud+ ~""5) <//"!E7++ 6:t ,D |nn..!3<<.%99oo a 1 12 33rN)rzSequence[TShouldStartContextFn]rzTShouldStartContextFn | Noner) __doc__ __future__rcollections.abcrtypesrcoverage.typesrrrrr rrr6s6)"$0 6 ! @4r