o [dd @sdddlZddlZddlZddlZddlZddlmZddZddZdd Z dd d Z dd dZ dS)N) constantscCsVt|}t|r|j}|j|jfSt|tjrt |j St|tj r)t |j SdSN) inspectunwrap isfunction__code__ co_filenameco_firstlineno isinstance functoolspartial_get_function_sourcefunc partialmethod)rcoder-/usr/lib/python3.10/asyncio/format_helpers.pyr s       rcCs8t||d}t|}|r|d|dd|d7}|S)Nz at r:r)_format_callbackr)rargs func_reprsourcerrr_format_callback_sources rcCsHg}|r|dd|D|r|dd|Ddd|S)zFormat function arguments and keyword arguments. Special case for a single parameter: ('hello',) is formatted as ('hello'). css|]}t|VqdSrreprlibrepr).0argrrr &sz*_format_args_and_kwargs..css(|]\}}|dt|VqdS)=Nr)rkvrrrr(s&z({})z, )extenditemsformatjoin)rkwargsr$rrr_format_args_and_kwargss r(cCst|tjrt|||}t|j|j|j|St|dr#|j r#|j }nt|dr/|j r/|j }nt |}|t||7}|r@||7}|S)N __qualname____name__) r r r r(rrrkeywordshasattrr*r+r)rrr'suffixrrrrr,s rcCsD|dur tj}|durtj}tjjt||dd}| |S)zlReplacement for traceback.extract_stack() that only does the necessary work for asyncio debug mode. NF)limit lookup_lines) sys _getframef_backrDEBUG_STACK_DEPTH traceback StackSummaryextract walk_stackreverse)fr/stackrrr extract_stack>s r<)r))NN) r rrr1r5r)rrrr(rr<rrrrs