
    Bh)              	         U d Z ddlmZ ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
Z
ddlmZ ddlZddlmZ dd	lmZ dd
lmZ ddlZej&                  dk\  rddlmZ ej,                  j.                  Zd/dZ G d dej4                        Zej8                  Zded<   d0dZd0dZ d1dZ!d2d3dZ"d4dZ#ddd	 	 	 	 	 	 	 d5dZ$d6dZ% e&d      D  ci c]  } |  e&dd      vs| d| d c} Z'e'jQ                   e)d       d! e)d"      d# e)d$      d%i       d7d&Z*d' Z+d( Z,d8d)Z-d9d*Z.d:d+Z/d;d,Z0 G d- d.      Z1yc c} w )<z"Python version compatibility code.    )annotations)CallableN)	Parameter)	Signature)Path)Any)Final)NoReturn      )Formatc                    t        |       S )zBInternal wrapper to prepare lazy proxies for legacy_path instances)LEGACY_PATH)paths    Y/var/www/html/Telegram-Engagement-Pod-/env/lib/python3.12/site-packages/_pytest/compat.pylegacy_pathr   #   s    t    c                      e Zd ZdZy)
NotSetTyper   N)__name__
__module____qualname__token r   r   r   r   +   s    Er   r   r	   NOTSETc                J    t        j                  |       xs t        | dd      S )az  Return True if func is a coroutine function (a function defined with async
    def syntax, and doesn't contain yield), or a function decorated with
    @asyncio.coroutine.

    Note: copied and modified from Python 3.5's builtin coroutines.py to avoid
    importing asyncio directly, which in turns also initializes the "logging"
    module as a side-effect (see issue #8).
    _is_coroutineF)inspectiscoroutinefunctiongetattrfuncs    r   r    r    1   s#     &&t,Uou0UUr   c                F    t        |       xs t        j                  |       S )zZReturn True if the given function seems to be an async function or
    an async generator.)r    r   isasyncgenfunctionr"   s    r   is_async_functionr&   =   s     t$H(B(B4(HHr   c                    t         j                  dk\  r%t        j                  | t        j
                        S t        j                  |       S )z0Return signature without evaluating annotations.r   )annotation_format)sysversion_infor   	signaturer   STRINGobjs    r   r+   r+   C   s8    
7"  FFS!!r   c                    t        |       } t        t        j                  |             }| j                  j
                  }|	 |j                  |      }| d|dz    S | d|dz    S # t        $ r Y w xY w)N:   )get_real_funcr   r   getfile__code__co_firstlinenorelative_to
ValueError)functioncurdirfnlinenorelfns        r   getlocationr=   J   s    X&H	gooh'	(B--F	+NN6*E WAfqj\**T6A:,	  		s   A( (	A43A4c                v   t        | dd      }|syt        t        j                  j                  d      dt	                     }t        t        j                  j                  d      dt	                     }t        |D cg c],  }|j                  s|j                  |u s|j                  |u r|. c}      S c c}w )z>Return number of arguments used up by mock arguments (if any).	patchingsNr   mockDEFAULTzunittest.mock)r!   r)   modulesgetobjectlenattribute_namenew)r8   r?   mock_sentinelut_mock_sentinelps        r   num_mock_patch_argsrK   X   s    +t4ICKKOOF3YIMs{{?FHU 	
##-'1554D+D 	
 	
s   >1B6 )nameclsc                  	 t        |       j                  j                         }t        d D              }|s| j                  }t        d	 |D              s-|r+t        t        j                  ||d
      t              s|dd }t        | d      r|t        |       d }|S # t        t        f$ r }ddlm}  |d| d| d       Y d}~d}~ww xY w)a   Return the names of a function's mandatory arguments.

    Should return the names of all function arguments that:
    * Aren't bound to an instance or type as in instance or class methods.
    * Don't have default values.
    * Aren't bound with functools.partial.
    * Aren't replaced with mocks.

    The cls arguments indicate that the function should be treated as a bound
    method even though it's not unless the function is a static method.

    The name parameter should be the original name in which the function was collected.
    r   )failz!Could not determine arguments of z: F)pytraceNc              3     K   | ]d  }|j                   t        j                  u s|j                   t        j                  u r*|j                  t        j
                  u r|j                   f y wNkindr   POSITIONAL_OR_KEYWORDKEYWORD_ONLYdefaultemptyrM   .0rJ   s     r   	<genexpr>z"getfuncargnames.<locals>.<genexpr>   sP      AFFi555vv///II( 	
s   A*A,c              3  T   K   | ]   }|j                   t        j                  u  " y wrS   )rU   r   POSITIONAL_ONLYrZ   s     r   r\   z"getfuncargnames.<locals>.<genexpr>   s      GJqqvv222Js   &()rX   r1   __wrapped__)r+   
parametersvaluesr7   	TypeError_pytest.outcomesrP   tupler   any
isinstancer   getattr_staticstaticmethodhasattrrK   )r8   rM   rN   r`   erP   	arg_namess          r   getfuncargnamesrl   k   s    8
x(33::<
   I   
 GJGG 	""3d;\
 abM	x'1(;=>	G 	" 
)/|2aSA	
 	

s   #B   C/C

Cc                h    t        d t        |       j                  j                         D              S )Nc              3     K   | ]X  }|j                   t        j                  t        j                  fv r*|j                  t        j
                  ur|j                   Z y wrS   rT   rZ   s     r   r\   z(get_default_arg_names.<locals>.<genexpr>   sI      8A66i55y7M7MNNIIY__, 	
8s   AA )rd   r+   r`   ra   )r8   s    r   get_default_arg_namesro      s2      8$//668  r             z\x02x	z\tz\r
z\nc                    t        | t              r| j                  dd      }n | j                  d      j                  d      }|j	                  t
              S )a	  If val is pure ASCII, return it as an str, otherwise, escape
    bytes objects into a sequence of escaped bytes:

    b'\xc3\xb4\xc5\xd6' -> r'\xc3\xb4\xc5\xd6'

    and escapes strings into a sequence of escaped unicode ids, e.g.:

    r'4\nV\U00043efa\x0eMXWB\x1e\u3028\u15fd\xcd\U0007d944'

    Note:
       The obvious "v.decode('unicode-escape')" will return
       valid UTF-8 unicode if it finds them in bytes, but we
       want to return escaped bytes for any byte, even if they match
       a UTF-8 string.
    asciibackslashreplaceunicode_escape)rf   bytesdecodeencode	translate$_non_printable_ascii_translate_table)valrets     r   ascii_escapedr      sI      #ujj"45jj)*11':===>>r   c                |    t        j                  |       } t        | t        j                        r| j
                  } | S )z{Get the real function object of the (possibly) wrapped object by
    :func:`functools.wraps`, or :func:`functools.partial`.)r   unwraprf   	functoolspartialr#   r-   s    r   r2   r2      s0     ..
C#y(()hhJr   c                >    	 | j                   S # t        $ r | cY S w xY wrS   )__func__AttributeErrorr"   s    r   	getimfuncr      s%    }} s    c                D    ddl m} 	 t        | ||      S # |$ r |cY S w xY w)aR  Like getattr but return default upon any Exception or any OutcomeException.

    Attribute access can potentially fail for 'evil' Python objects.
    See issue #214.
    It catches OutcomeException because of #2490 (issue #580), new outcomes
    are derived from BaseException instead of Exception (for more details
    check #2707).
    r   )TEST_OUTCOME)rc   r   r!   )rD   rM   rX   r   s       r   safe_getattrr      s/     .vtW-- s    c                L    	 t        j                  |       S # t        $ r Y yw xY w)z0Ignore any exception via isinstance on Python 3.F)r   isclass	Exceptionr-   s    r   safe_isclassr      s(    s## s    	##c                     t         j                  dk(  st         j                  dk(  ryd} t        j                         }|| k7  r|S dS )zReturn the current process's real user id or None if it could not be
    determined.

    :return: The user id or None if it could not be determined.
    win32
emscriptenN)r)   platformosgetuid)ERRORuids     r   get_user_idr     sC     ||w#,,,">  iikUls,,r   c                D    J d|  dt        |       j                   d       )NzUnhandled value: z ())typer   )values    r   assert_neverr   8  s'    F%eWBtE{/C/C.DAFF5r   c                  (    e Zd ZdZddZddZddZy)CallableBoola'  
    A bool-like object that can also be called, returning its true/false value.

    Used for backwards compatibility in cases where something was supposed to be a method
    but was implemented as a simple attribute by mistake (see `TerminalReporter.isatty`).

    Do not use in new code.
    c                    || _         y rS   _value)selfr   s     r   __init__zCallableBool.__init__F  s	    r   c                    | j                   S rS   r   r   s    r   __bool__zCallableBool.__bool__I      {{r   c                    | j                   S rS   r   r   s    r   __call__zCallableBool.__call__L  r   r   N)r   boolreturnNone)r   r   )r   r   r   __doc__r   r   r   r   r   r   r   r   <  s    r   r   )r   zstr | os.PathLike[str]r   r   )r#   rD   r   r   )r.   Callable[..., Any]r   r   rS   )r9   zstr | os.PathLike[str] | Noner   str)r   int)r8   zCallable[..., object]rM   r   rN   ztype | Noner   tuple[str, ...])r8   r   r   r   )r   zbytes | strr   r   )rD   r   rM   r   rX   r   r   r   )r.   rD   r   r   )r   z
int | None)r   r
   r   r
   )2r   
__future__r   collections.abcr   enumr   r   r   r   r   pathlibr   r)   typingr   r	   r
   pyr*   annotationlibr   r   localr   r   Enumr   r   r   __annotations__r    r&   r+   r=   rK   rl   ro   ranger   updateordr   r2   r   r   r   r   r   r   )is   0r   <module>r      sm   ( " $      	  
    	 w$ ggnn     	VI" , 	A#A A 
	A
 AH	 $Cj((AU2s^,CAQsG}j( $ % + +Ys4y%TE:
?."-hG C(s   D>$	D>