
    Rhd	                     Z    d dl Z d dlZd dlZd dlZd dlZddlmZ d Zd Zd Z	d	dZ
d
dZy)    N   )	constantsc                 \   t        j                  |       } t        j                  |       r$| j                  }|j                  |j
                  fS t        | t        j                        rt        | j                        S t        | t        j                        rt        | j                        S y N)inspectunwrap
isfunction__code__co_filenameco_firstlineno
isinstance	functoolspartial_get_function_sourcefuncpartialmethod)r   codes     -/usr/lib/python3.12/asyncio/format_helpers.pyr   r   
   s    >>$D$}}  $"5"566$	))*#DII..$	//0#DII..    c                 \    t        | |d       }t        |       }|r|d|d    d|d    z  }|S )Nz at r   :r   )_format_callbackr   )r   args	func_reprsources       r   _format_callback_sourcer      sB     tT2I!$'FtF1I;aq	{33	r   c                     g }| r|j                  d | D               |r&|j                  d |j                         D               dj                  dj                  |            S )zFormat function arguments and keyword arguments.

    Special case for a single parameter: ('hello',) is formatted as ('hello').
    c              3   F   K   | ]  }t        j                  |        y wr   reprlibrepr).0args     r   	<genexpr>z*_format_args_and_kwargs.<locals>.<genexpr>&   s     73W\\#&7s   !c              3   V   K   | ]!  \  }}| d t        j                  |        # yw)=Nr   )r"   kvs      r   r$   z*_format_args_and_kwargs.<locals>.<genexpr>(   s(     I$!Qs!GLLO,-Is   ')z({})z, )extenditemsformatjoin)r   kwargsr*   s      r   _format_args_and_kwargsr.      sQ     E7$77I&,,.II==5)**r   c                    t        | t        j                        r;t        ||      |z   }t	        | j
                  | j                  | j                  |      S t        | d      r| j                  r| j                  }n0t        | d      r| j                  r| j                  }nt        |       }|t        ||      z  }|r||z  }|S )N__qualname____name__)r   r   r   r.   r   r   r   keywordshasattrr0   r1   r!   )r   r   r-   suffixr   s        r   r   r   ,   s    $	))*(v6?		499dmmVLLt^$):):%%		z	"t}}MM	J	(v66IV	r   c                     | t        j                         j                  } |t        j                  }t
        j                  j                  t        j                  |       |d      }|j                          |S )zlReplacement for traceback.extract_stack() that only does the
    necessary work for asyncio debug mode.
    F)limitlookup_lines)
sys	_getframef_backr   DEBUG_STACK_DEPTH	tracebackStackSummaryextract
walk_stackreverse)fr6   stacks      r   extract_stackrC   >   sj     	yMMO""} ++""**9+?+?+B168= + ?E 
MMOLr   ) )NN)r   r   r    r8   r<   rD   r   r   r   r.   r   rC    r   r   <module>rF      s0       
  	+$r   