
    ESj)              	         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mZ ddlZej(                  dk\  rddlmZ ej.                  j0                  Zd8dZ G d dej6                        Zej:                  Zded<   d9dZ d9dZ!d:dZ"d;d<dZ#d=dZ$ddd	 	 	 	 	 	 	 d>dZ%d?dZ& e'd      D  ci c]  } |  e'dd      vs| d| d  c} Z(e(jS                   e*d!      d" e*d#      d$ e*d%      d&i       d@d'Z+d( Z,d) Z-dAd*Z.dBd+Z/dCd,Z0ej(                  d-k\  rdd.lm1Z1 ndDd/Z1 G d0 d1      Z2dEd2Z3ej(                  d3k\  rdd4l4m5Z5 yerdd4l6m5Z5 ydd5d6d7Z5yc c} w )Fz?Python version compatibility code and random general utilities.    )annotations)CallableN)	Parameter)	Signature)Path)Any)Final)NoReturn)TYPE_CHECKING      )Formatc                    t        |       S )zBInternal wrapper to prepare lazy proxies for legacy_path instances)LEGACY_PATH)paths    _/Users/ahmed/devFolder/Ultron/claude-voice/.venv/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!   2   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,   D   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>   K   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)r9   r@   mock_sentinelut_mock_sentinelps        r   num_mock_patch_argsrL   Y   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emptyrN   .0rK   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rT   )rV   r   POSITIONAL_ONLYr[   s     r   r]   z"getfuncargnames.<locals>.<genexpr>   s      GJqqvv222Js   &()rY   r2   __wrapped__)r,   
parametersvaluesr8   	TypeError_pytest.outcomesrQ   tupler   any
isinstancer    getattr_staticstaticmethodhasattrrL   )r9   rN   rO   ra   erQ   	arg_namess          r   getfuncargnamesrm   l   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rT   rU   r[   s     r   r]   z(get_default_arg_names.<locals>.<genexpr>   sI      8A66i55y7M7MNNIIY__, 	
8s   AA )re   r,   ra   rb   )r9   s    r   get_default_arg_namesrp      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)rg   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    unwraprg   	functoolspartialr$   r.   s    r   r3   r3      s0     ..
C#y(()hhJr   c                >    	 | j                   S # t        $ r | cY S w xY wrT   )__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)rd   r   r"   )rE   rN   rY   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   )r      )assert_neverc                D    J d|  dt        |       j                   d       )NzUnhandled value: z ())typer   )values    r   r   r     s'    J)%4;3G3G2HJJur   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 rT   _value)selfr   s     r   __init__zCallableBool.__init__,  s	    r   c                    | j                   S rT   r   r   s    r   __bool__zCallableBool.__bool__/      {{r   c                    | j                   S rT   r   r   s    r   __call__zCallableBool.__call__2  r   r   N)r   boolreturnNoner   r   )r   r   r   __doc__r   r   r   r   r   r   r   r   "  s    r   r   c                 .    ddg} t        d | D              S )z0Check if we're currently running on a CI system.CIBUILD_NUMBERc              3  Z   K   | ]#  }t         j                  j                  |       % y wrT   )r   environrD   )r\   vars     r   r]   z running_on_ci.<locals>.<genexpr>;  s     7hsrzz~~c"hs   )+)rf   )env_varss    r   running_on_cir   6  s     n%H7h777r   )r      )
deprecatedr2   )category
stacklevelc                  d }|S )Nc                    | S rT   r   r#   s    r   	decoratorzdeprecated.<locals>.decoratorF  s    r   r   )msgr   r   r   s       r   r   r   E  s     r   )r   zstr | os.PathLike[str]r   r   )r$   rE   r   r   )r/   Callable[..., Any]r   r   rT   )r:   zstr | os.PathLike[str] | Noner   str)r   int)r9   zCallable[..., object]rN   r   rO   ztype | Noner   tuple[str, ...])r9   r   r   r   )r   zbytes | strr   r   )rE   r   rN   r   rY   r   r   r   )r/   rE   r   r   )r   z
int | None)r   r
   r   r
   r   )7r   
__future__r   collections.abcr   enumr   r    r   r   r   pathlibr   r*   typingr   r	   r
   r   pyr+   annotationlibr   r   localr   r   Enumr   r   r   __annotations__r!   r'   r,   r>   rL   rm   rp   ranger   updateordr   r3   r   r   r   r   r   r   r   warningsr   typing_extensions)is   0r   <module>r      s   E " $      	  
      	 w$ ggnn     	VI" , 	A#A A 
	A
 AH	 $Cj((AU2s^,CAQsG}j( $ % + +Ys4y%TE:
?."-* w#K (8 w1> ,0A 	S(s   F*	F