
    ESj                        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y)    )annotationsN)Mapping)	TypeGuardc                p    t        | t        j                  j                        xr t        | t               S N)
isinstancecollectionsabcSequencestrxs    j/Users/ahmed/devFolder/Ultron/claude-voice/.venv/lib/python3.12/site-packages/_pytest/assertion/_guards.py
issequencer   	   s(    a112M:a;M7MM    c                "    t        | t              S r   )r   r   r   s    r   istextr      s    ar   c                "    t        | t              S r   )r   r   r   s    r   	ismappingr      s    a!!r   c                0    t        | t        t        z        S r   )r   set	frozensetr   s    r   issetr      s    ay))r   c                D    t        | t              xr t        | dd       d uS )N_fields)r   tuplegetattrobjs    r   isnamedtupler       s"    c5!Ogc9d&C4&OOr   c                     t        | dd       d uS )N__attrs_attrs__)r   r   s    r   isattrsr#       s    3)40<<r   c                P    	 t        |        t        |        S # t        $ r Y yw xY w)NF)iterr   	Exceptionr   s    r   
isiterabler'   $   s,    S	#; s    	%%c                    t        | j                  d      rTt        | j                  j                  d      r4| j                  j                  j                  }t	        |       rd|v S |dk(  S y)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__r)   r*   r#   )r   code_filenames     r   has_default_eqr.   ,   sZ     szz:&73::3F3F+V

++773<%66
**r   )r   objectreturnz+TypeGuard[collections.abc.Sequence[object]])r   r/   r0   zTypeGuard[str])r   r/   r0   z"TypeGuard[Mapping[object, object]])r   r/   r0   z*TypeGuard[set[object] | frozenset[object]])r   r/   r0   bool)r   r/   r0   z+TypeGuard[collections.abc.Iterable[object]])
__future__r   collections.abcr	   r   dataclassestypingr   r   r   r   r   r    is_dataclass	isdataclsr#   r'   r.    r   r   <module>r9      sK    "  #  N"*P $$	=r   