
    [j                        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	ZddZ	ddZ
ddZddZej        ZddZddZddZdS )    )annotationsN)Mapping)	TypeGuardxobjectreturn+TypeGuard[collections.abc.Sequence[object]]c                l    t          | t          j        j                  ot          | t                     S N)
isinstancecollectionsabcSequencestrr   s    ]/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/_pytest/assertion/_guards.py
issequencer   	   s)    a122M:a;M;M7MM    TypeGuard[str]c                ,    t          | t                    S r   )r   r   r   s    r   istextr      s    ar   "TypeGuard[Mapping[object, object]]c                ,    t          | t                    S r   )r   r   r   s    r   	ismappingr      s    a!!!r   *TypeGuard[set[object] | frozenset[object]]c                <    t          | t          t          z            S r   )r   set	frozensetr   s    r   issetr      s    ay)))r   objboolc                R    t          | t                    ot          | dd           d uS )N_fields)r   tuplegetattrr    s    r   isnamedtupler'      s(    c5!!Ogc9d&C&C4&OOr   c                (    t          | dd           d uS )N__attrs_attrs__)r%   r&   s    r   isattrsr*       s    3)400<<r   +TypeGuard[collections.abc.Iterable[object]]c                d    	 t          |            t          |            S # t          $ r Y dS w xY w)NF)iterr   	Exceptionr&   s    r   
isiterabler/   $   sB    S			#;;   uus   ! 
//c                    t          | j        d          rDt          | j        j        d          r*| j        j        j        }t	          |           rd|v S |dk    S dS )a  Check if an instance of an object contains the default eq

    First, we check if the object's __eq__ attribute has __code__,
    if so, we check the equally of the method code filename (__code__.co_filename)
    to the default one generated by the dataclass and attr module
    for dataclasses the default co_filename is <string>, for attrs class, the __eq__ should contain "attrs eq generated"
    __code__co_filenamezattrs generated z<string>T)hasattr__eq__r1   r2   r*   )r    code_filenames     r   has_default_eqr6   ,   sd     sz:&& +73:3F+V+V +
+73<< 	7%66
**4r   )r   r   r   r	   )r   r   r   r   )r   r   r   r   )r   r   r   r   )r    r   r   r!   )r    r   r   r+   )
__future__r   collections.abcr   r   dataclassestypingr   r   r   r   r   r'   is_dataclass	isdataclsr*   r/   r6    r   r   <module>r>      s   " " " " " "     # # # # # #          N N N N   " " " "* * * *P P P P $	= = = =        r   