
    F-PhV&              	         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        j        ZdAdZ G d dej                  Zej        Zded<   dBdZdBdZdCdDdZdEdZddd dFd'Z dGd)Z!d*  e"d+          D             Z#e#$                     e%d,          d- e%d.          d/ e%d0          d1i           dHd4Z&d5 Z'd6 Z(dId9Z)dJd;Z*dKd=Z+dLd@Z,dS )Mz"Python version compatibility code.    )annotations)CallableN)	Parameter)	signature)Path)Any)Final)NoReturnpathstr | os.PathLike[str]returnLEGACY_PATHc                     t          |           S )zBInternal wrapper to prepare lazy proxies for legacy_path instances)r   )r   s    N/var/www/html/test/jupyter/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!   -   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&   9   s"     t$$H(B4(H(HHr   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)functionr'   fnlinenorelfns        r   getlocationr7   ?   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>W   sM     	
 	
 	
#	
 -''154D+D+D  ,E+D+Dr   )r"   sysmodulesgetr   len)r3   r:   rB   rC   s     @@r   num_mock_patch_argsrI   M   s    +t44I qCKOOF33YIIMs{??FHHUU	
 	
 	
 	
 	
	
 	
 	
  r    )nameclsr3   Callable[..., object]rK   rL   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emptyrK   r@   rA   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 rT   )rV   r   POSITIONAL_ONLYr[   s     r   r\   z"getfuncargnames.<locals>.<genexpr>   s,      GGqqv22GGGGGGr   )rY   r,   __wrapped__)r   
parametersvaluesr2   	TypeError_pytest.outcomesrQ   tupler   any
isinstancer    getattr_staticstaticmethodhasattrrI   )r3   rK   rL   r`   erQ   	arg_namess          r   getfuncargnamesrl   `   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Callable[..., Any]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 rT   rU   r[   s     r   r\   z(get_default_arg_names.<locals>.<genexpr>   sY        6i5y7MNNNIY_,, 	
 -,,,	 r   )rd   r   r`   ra   )r3   s    r   get_default_arg_namesrp      sI       8$$/6688     r   c                @    i | ]}|t          d d          v|d|dS )       z\x02x)range)r@   is     r   
<dictcomp>rw      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)rf   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    unwraprf   	functoolspartialr   objs    r   r-   r-      s4     .

C#y()) hJr   c                6    	 | j         S # t          $ r | cY S w xY wrT   )__func__AttributeErrorr#   s    r   	getimfuncr      s3    }   s   	 r   rY   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)rc   r   r"   )r   rK   rY   r   s       r   safe_getattrr      sQ     .-----vtW---   s    ##r   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	Exceptionr   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)rE   platformosgetuid)ERRORuids     r   get_user_idr      sH     |w#,,">"> t ikkUllss,r   valuer
   c                H    J d|  dt          |           j         d            )NFzUnhandled value: z ())typer   )r   s    r   assert_neverr   -  s-    FFeFFtE{{/CFFFFFFr   )r   r   r   r   )r   r   r   r   rT   )r'   r(   r   r)   )r   r8   )r3   rM   rK   r)   rL   rN   r   rO   )r3   rm   r   rO   )r|   r}   r   r)   )r   r   rK   r)   rY   r   r   r   )r   r   r   r   )r   r   )r   r
   r   r
   )-__doc__
__future__r   collections.abcr   enumr   r    r   r   r   pathlibr   rE   typingr   r	   r
   pyr   localr   r   Enumr   r   r   __annotations__r!   r&   r7   rI   rl   rp   ru   r   updateordr   r-   r   r   r   r   r   r   r   r   <module>r      s   ( ( ( " " " " " " $ $ $ $ $ $                   				       



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