o
    g8"                     @  s  d Z ddlmZ ddlZddlZddlZddlZddl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
mZ ddl
mZ ddl
mZ dd	l
mZ dd
l
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ e	jdkZe	jdkZe	jdkZe	jdkZe	jdkZe	jdkZe dkZe dkZ e	j!dZ"e	j!dZ#de$ % v Z&e	j'dkZ(e)e Z*ej+Z,edddZ-G dd  d e
j.Z/did$d%Z0erdjd'd(Z1ndjd)d(Z1e
j2serdd*l3m4Z5 nddl5Z5e
j2serej6Z7ndkd.d/Z7ere8Z9ne: Z;dd0l<m=Z= e;fd1d2Z9d3d4 Z>d5d- Z?dld9d:Z@dmd;d<ZAdnd?d@ZBdAdB ZCdodCdDZDddddEi i eEdFdG dHdG dIdG dJdG eDfdpd`daZFdqdedfZGdqdgdhZHdS )rz1Handle Python version/platform incompatibilities.    )annotationsN)Any)Callable)Dict)Iterable)List)Mapping)Optional)Sequence)Set)Tuple)Type)TypeVar)      )r      )r      )r   
   )r   	   )r      PyPyCPythonwindarwinaarchl        _T_coT)	covariantc                   @  sF   e Zd ZU ded< ded< ded< ded< ded< d	ed
< ded< dS )FullArgSpec	List[str]argsOptional[str]varargsvarkwzOptional[Tuple[Any, ...]]defaults
kwonlyargszOptional[Dict[str, Any]]kwonlydefaultszDict[str, Any]r   N)__name__
__module____qualname____annotations__ r*   r*   X/var/www/html/ecg_monitoring/venv/lib/python3.10/site-packages/sqlalchemy/util/compat.pyr   8   s   
 r   funcCallable[..., Any]returnc           	      C  s   t | r| j} t | st| d| j}t |s#t|d|j}|j}|j	}t
|d| }t
||||  }||7 }d}|jt j@ rS|j| }|d }d}|jt j@ r`|j| }t|||| j|| j| jS )z9Fully vendored version of getfullargspec from Python 3.3.z is not a Python functionz is not a code objectN   )inspectismethod__func__
isfunction	TypeError__code__iscodeco_argcountco_varnamesco_kwonlyargcountlistco_flags
CO_VARARGSCO_VARKEYWORDSr   __defaults____kwdefaults__r)   )	r,   conargsnamesnkwargsr   r$   r!   r"   r*   r*   r+   inspect_getfullargspecB   s:   




rD   r   c                   C  s   t jddS )NF)usedforsecurityhashlibmd5r*   r*   r*   r+   md5_not_for_securityk   s   rI   c                   C  s   t  S NrF   r*   r*   r*   r+   rI   p   s   )metadataadictbc                 C  s   |   } | | | S rJ   )copyupdaterL   rN   r*   r*   r+   
dict_union   s   
rR   )AsyncIteratorc                   sZ   t | tstdt|  t| j}z|| I dH W S  ty,   |tu r( | Y S w )z9vendored from https://github.com/python/cpython/pull/8895z%anext expected an AsyncIterator, got N)
isinstancerS   r4   type	__anext__StopAsyncIteration_NOT_PROVIDED)async_iteratordefaultanxtr*   r*   r+   anext_   s   

r\   c                 C  s0   t  }tjst|dr|j| dS || dS )Nselect)groupr*   )importlib_metadataentry_pointstypingTYPE_CHECKINGhasattrr]   get)r^   epr*   r*   r+   importlib_metadata_get   s   rf   c                 C  s
   |  dS )Nzlatin-1)encode)sr*   r*   r+   rN      s   
xstrbytesc                 C  s   t | dS Nascii)base64	b64decoderg   ri   r*   r*   r+   ro         ro   c                 C  s   t | dS rl   )rn   	b64encodedecoderp   r*   r*   r+   rr      rq   rr   textencodingc                 C  s   | j |ddS )Nbackslashreplace)errors)rs   )rt   ru   r*   r*   r+   decode_backslashreplace   s   rx   c                 C  s   | |k| |k  S rJ   r*   rQ   r*   r*   r+   cmp   rq   ry   c                 C  s   t | tr| S t| dddkrt| ddddS t | tr4| jd|fv r,t| jS | jd | j S t | tj	rBt| ddS t| ddS )	zvendored from python 3.7r'   Nra   ztyping. ~builtins.)
rT   rj   getattrreprreplacerU   r'   r(   ra   r   )
annotationbase_moduler*   r*   r+   _formatannotation   s   


r   r*   c                 C     d|  S )N*r*   namer*   r*   r+   <lambda>       r   c                 C  r   )Nz**r*   r   r*   r*   r+   r      r   c                 C     dt |  S )N=)r   )valuer*   r*   r+   r          c                 C  r   )Nz -> )rj   )rt   r*   r*   r+   r      r   r   r   r!   r    r"   r#   Optional[Sequence[Any]]r$   Optional[Sequence[str]]r%   Optional[Mapping[str, Any]]r   Mapping[str, Any]	formatargCallable[[str], str]formatvarargsformatvarkwformatvalueCallable[[Any], str]formatreturnsformatannotationc                   s4  |pi } pi   fdd}g }|rt | t | }nd}t| D ]\}}||}|r;||kr;||
|||   }|| q#|durO|||| n|rV|d |rt|D ]}||}|rn||v rn||
|| 7 }|| qZ|dur||	|| dd| d }d	 v r|| d	 7 }|S )
a>  Copy formatargspec from python 3.7 standard library.

    Python 3 has deprecated formatargspec and requested that Signature
    be used instead, however this requires a full reimplementation
    of formatargspec() in terms of creating Parameter objects and such.
    Instead of introducing all the object-creation overhead and having
    to reinvent from scratch, just copy their compatibility routine.

    Ultimately we would need to rewrite our "decorator" routine completely
    which is not really worth it right now, until all Python 2.x support
    is dropped.

    c                   s(   | }|  v r|d |   7 }|S )Nz: r*   )argresultr   r   r   r*   r+   formatargandannotation   s   z5inspect_formatargspec.<locals>.formatargandannotationNr   (z, )r.   )len	enumerateappendjoin)r   r!   r"   r#   r$   r%   r   r   r   r   r   r   r   r   specsfirstdefaultir   spec	kwonlyargr   r*   r   r+   inspect_formatargspec   s8   
r   cls	Type[Any] Iterable[dataclasses.Field[Any]]c                 C  s   t | r
t | S g S )zReturn a sequence of all dataclasses.Field objects associated
    with a class as an already processed dataclass.

    The class must **already be a dataclass** for Field objects to be returned.

    )dataclassesis_dataclassfields)r   r*   r*   r+   dataclass_fields  s   

r   c                   sF   t | r!t  | jD ]	} t| q fddt | D S g S )zReturn a sequence of all dataclasses.Field objects associated with
    an already processed dataclass, excluding those that originate from a
    superclass.

    The class must **already be a dataclass** for Field objects to be returned.

    c                   s   g | ]}| vr|qS r*   r*   ).0fsuper_fieldsr*   r+   
<listcomp>+  s    z*local_dataclass_fields.<locals>.<listcomp>)r   r   set	__bases__rP   r   r   )r   supr*   r   r+   local_dataclass_fields  s   
	
r   )r,   r-   r.   r   )r.   r   )rL   rM   rN   rM   r.   rM   )ri   rj   r.   rk   )ri   rk   r.   rj   )rt   rk   ru   rj   r.   rj   rJ   )r   r   r!   r    r"   r    r#   r   r$   r   r%   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r.   rj   )r   r   r.   r   )I__doc__
__future__r   rn   r   rG   r0   operatorplatformsysra   r   r   r   r   r   r   r	   r
   r   r   r   r   version_infopy313py312py311py310py39py38python_implementationpypycpython
startswithwin32osxmachinelowerarmmaxsizeis64bitboolhas_refcount_gc
attrgetterdottedgetterr   
NamedTupler   rD   rI   rb   	importlibrK   r_   or_rR   anextr\   objectrX   collections.abcrS   rf   rN   ro   rr   rx   ry   r   rj   r   r   r   r*   r*   r*   r+   <module>   s   








&








H