
    [j)              	         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        j        ZdPdZ G d dej                  Zej        Zded<   dQdZ dQdZ!dRdZ"dSdTd#Z#dUd%Z$d&dd'dVd.Z%dWd/Z&d0  e'd1          D             Z(e()                     e*d2          d3 e*d4          d5 e*d6          d7i           dXd:Z+d; Z,d< Z-dYd?Z.dZd@Z/d[dBZ0ej        dCk    rddDlm1Z1 nd\dGZ1 G dH dI          Z2d]dJZ3ej        dKk    rddLl4m5Z5 dS erddLl6m5Z5 dS ddMdNdOZ5dS )^z?Python version compatibility code and random general utilities.    )annotations)CallableN)	Parameter)	Signature)Path)Any)Final)NoReturn)TYPE_CHECKING      )Formatpathstr | os.PathLike[str]returnLEGACY_PATHc                     t          |           S )zBInternal wrapper to prepare lazy proxies for legacy_path instances)r   )r   s    R/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/_pytest/compat.pylegacy_pathr   $   s    t    c                      e Zd ZdZdS )
NotSetTyper   N)__name__
__module____qualname__token r   r   r   r   ,   s        EEEr   r   r	   NOTSETfuncobjectboolc                L    t          j        |           p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r    s    r   r&   r&   2   s&     &t,,Uou0U0UUr   c                H    t          |           p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(B4(H(HHr   objCallable[..., Any]r   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r,   s    r   r2   r2   D   s9    
7"" FFFFS!!!r   curdirstr | os.PathLike[str] | Nonestrc                    t          |           } t          t          j        |                     }| j        j        }|0	 |                    |          }| d|dz    S # t          $ r Y nw xY w| d|dz    S )N:   )get_real_funcr   r%   getfile__code__co_firstlinenorelative_to
ValueError)functionr5   fnlinenorelfns        r   getlocationrE   K   s    X&&H	goh''	(	(B-F	+NN6**E **fqj***  	 	 	D	 6A:s    A 
A,+A,intc                P   t          | dd          }|sdS t          t          j                            d          dt	                                t          t          j                            d          dt	                                t          fd|D                       S )z>Return number of arguments used up by mock arguments (if any).	patchingsNr   mockDEFAULTzunittest.mockc                F    g | ]}|j         s|j        u s	|j        u |S r   )attribute_namenew).0pmock_sentinelut_mock_sentinels     r   
<listcomp>z'num_mock_patch_args.<locals>.<listcomp>c   sM     	
 	
 	
#	
 -''154D+D+D  ,E+D+Dr   )r'   r0   modulesgetr!   len)rA   rH   rP   rQ   s     @@r   num_mock_patch_argsrV   Y   s    +t44I qCKOOF33YIIMs{??FHHUU	
 	
 	
 	
 	
	
 	
 	
  r    )nameclsrA   Callable[..., object]rX   rY   type | Nonetuple[str, ...]c                  	 t          |           j                                        }n7# t          t          f$ r#}ddlm}  |d| d| d           Y d}~nd}~ww xY wt          d |D                       }|s| j        }t          d	 |D                       s6|r4t          t          j        ||d
          t                    s
|dd         }t          | d          r|t          |           d         }|S )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 ;|j        V  Ed S Nkindr   POSITIONAL_OR_KEYWORDKEYWORD_ONLYdefaultemptyrX   rN   rO   s     r   	<genexpr>z"getfuncargnames.<locals>.<genexpr>   sa        Fi555v///I(( 	
 )((( r   c              3  <   K   | ]}|j         t          j        u V  d S ra   )rc   r   POSITIONAL_ONLYrh   s     r   ri   z"getfuncargnames.<locals>.<genexpr>   s,      GGqqv22GGGGGGr   )rf   r:   __wrapped__)r2   
parametersvaluesr@   	TypeError_pytest.outcomesr^   tupler   any
isinstancer%   getattr_staticstaticmethodhasattrrV   )rA   rX   rY   rm   er^   	arg_namess          r   getfuncargnamesry   l   sx   8
x((3::<<

	" 
 
 
))))))AAAaAA	
 	
 	
 	
 	
 	
 	
 	
 	

       I  ! 
 GGJGGGGG " 	" "3d;;;\
 
	" abbM	x'' ?1(;;==>	s   &) AAAc                |    t          d t          |           j                                        D                       S )Nc              3     K   | ]=}|j         t          j        t          j        fv r|j        t          j        u4|j        V  >d S ra   rb   rh   s     r   ri   z(get_default_arg_names.<locals>.<genexpr>   sY        6i5y7MNNNIY_,, 	
 -,,,	 r   )rq   r2   rm   rn   )rA   s    r   get_default_arg_namesr|      sI       8$$/6688     r   c                @    i | ]}|t          d d          v|d|dS )       z\x02x)range)rN   is     r   
<dictcomp>r      s;     ( ( (AU2s^^,C,CA}Q}}},C,C,Cr      	z\tz\r
z\nvalbytes | strc                    t          | t                    r|                     dd          }n(|                     d                              d          }|                    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)rs   bytesdecodeencode	translate$_non_printable_ascii_translate_table)r   rets     r   ascii_escapedr      s_      #u ;jj"455jj)**11'::===>>>r   c                p    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%   unwraprs   	functoolspartialr    r4   s    r   r;   r;      s4     .

C#y()) hJr   c                6    	 | j         S # t          $ r | cY S w xY wra   )__func__AttributeErrorr(   s    r   	getimfuncr      s3    }   s   	 r   rf   c                L    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)rp   r   r'   )r!   rX   rf   r   s       r   safe_getattrr      sQ     .-----vtW---   s    ##c                N    	 t          j        |           S # t          $ r Y dS w xY w)z0Ignore any exception via isinstance on Python 3.F)r%   isclass	Exceptionr4   s    r   safe_isclassr      s9    s###   uus    
$$
int | Nonec                     t           j        dk    st           j        dk    rdS d} t          j                    }|| k    r|n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)r0   platformosgetuid)ERRORuids     r   get_user_idr     sH     |w#,,">"> t ikkUllss,r   )r      )assert_nevervaluer
   c                H    J d|  dt          |           j         d            )NFzUnhandled value: z ())typer   )r   s    r   r   r     s-    JJ%JJ4;;3GJJJJJJr   c                  *    e Zd ZdZd
dZddZddZd	S )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.
    r   r"   r   Nonec                    || _         d S ra   _value)selfr   s     r   __init__zCallableBool.__init__,  s    r   c                    | j         S ra   r   r   s    r   __bool__zCallableBool.__bool__/  
    {r   c                    | j         S ra   r   r   s    r   __call__zCallableBool.__call__2  r   r   N)r   r"   r   r   r   r"   )r   r   r   __doc__r   r   r   r   r   r   r   r   "  sZ                    r   r   c                 <    ddg} t          d | D                       S )z0Check if we're currently running on a CI system.CIBUILD_NUMBERc              3  T   K   | ]#}t           j                            |          V  $d S ra   )r   environrT   )rN   vars     r   ri   z running_on_ci.<locals>.<genexpr>;  s0      77srz~~c""777777r   )rr   )env_varss    r   running_on_cir   6  s+     n%H77h777777r   )r      )
deprecatedr:   )category
stacklevelc                  d }|S )Nc                    | S ra   r   r(   s    r   	decoratorzdeprecated.<locals>.decoratorF  s    r   r   )msgr   r   r   s       r   r   r   E  s       r   )r   r   r   r   )r    r!   r   r"   )r,   r-   r   r   ra   )r5   r6   r   r7   )r   rF   )rA   rZ   rX   r7   rY   r[   r   r\   )rA   r-   r   r\   )r   r   r   r7   )r!   r   rX   r7   rf   r   r   r   )r,   r!   r   r"   )r   r   )r   r
   r   r
   r   )7r   
__future__r   collections.abcr   enumr   r%   r   r   r   pathlibr   r0   typingr   r	   r
   r   pyr1   annotationlibr   r   localr   r   Enumr   r   r   __annotations__r&   r+   r2   rE   rV   ry   r|   r   r   updateordr   r;   r   r   r   r   r   r   r   warningsr   typing_extensionsr   r   r   <module>r      s   E E E " " " " " " $ $ $ $ $ $                   				       



                               				 w$$$$$$ gn                   	V 	V 	V 	VI I I I" " " "            , 	A A A A A AH	 	 	 	( (#eCjj( ( ( $ % + +SYYss4yy%TE:  
? ? ? ?.       "   - - - -* w#######K K K K       (8 8 8 8 w11111111 >>>>>>>> ,0A 	 	 	 	 	 	 	r   