
    hd	                     \    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dS )    N   )	constantsc                 8   t          j        |           } t          j        |           r| j        }|j        |j        fS t          | t          j                  rt          | j
                  S t          | t          j                  rt          | j
                  S d S N)inspectunwrap
isfunction__code__co_filenameco_firstlineno
isinstance	functoolspartial_get_function_sourcefuncpartialmethod)r   codes     -/usr/lib/python3.11/asyncio/format_helpers.pyr   r   
   s    >$D$ 7} $"566$	)** /#DI...$	/00 /#DI...4    c                 x    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      sQ     tT22I!$''F 43F1I33q	333	r   c                     g }| r|                     d | D                        |r1|                     d |                                D                        d                    d                    |                    S )zFormat function arguments and keyword arguments.

    Special case for a single parameter: ('hello',) is formatted as ('hello').
    c              3   >   K   | ]}t          j        |          V  d S r   reprlibrepr).0args     r   	<genexpr>z*_format_args_and_kwargs.<locals>.<genexpr>&   s,      773W\#&&777777r   c              3   N   K   | ] \  }}| d t          j        |           V  !dS )=Nr   )r"   kvs      r   r$   z*_format_args_and_kwargs.<locals>.<genexpr>(   s<      II$!Q--GLOO--IIIIIIr   z({})z, )extenditemsformatjoin)r   kwargsr*   s      r   _format_args_and_kwargsr.      s     E 877$777777 JII&,,..IIIIII==5))***r    c                 p   t          | t          j                  r4t          ||          |z   }t	          | j        | j        | j        |          S t          | d          r| j	        r| j	        }n.t          | d          r| j
        r| j
        }nt          |           }|t          ||          z  }|r||z  }|S )N__qualname____name__)r   r   r   r.   r   r   r   keywordshasattrr1   r2   r!   )r   r   r-   suffixr   s        r   r   r   ,   s    $	)** M(v66?	49dmVLLLt^$$ ): %			z	"	" t} M		JJ	(v666I V	r   c                     | t          j                    j        } |t          j        }t
          j                            t          j        |           |d          }|	                                 |S )zlReplacement for traceback.extract_stack() that only does the
    necessary work for asyncio debug mode.
    NF)limitlookup_lines)
sys	_getframef_backr   DEBUG_STACK_DEPTH	tracebackStackSummaryextract
walk_stackreverse)fr7   stacks      r   extract_stackrD   >   sj     	yMOO"} +"**9+?+B+B168= + ? ?E 
MMOOOLr   )r/   )NN)r   r   r    r9   r=   r/   r   r   r   r.   r   rD    r   r   <module>rF      s          



          	 	 	  + + +   $     r   