HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/sqlalchemy/util/__pycache__/compat.cpython-310.pyc
o

���g8"�@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddl
mZddl
mZddl
m
Z
ddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddl
mZdd
l
mZddl
mZddl
mZe	jdkZe	jdkZe	jdkZe	jdkZe	jdkZe	jdkZe��dkZe��dkZ e	j�!d�Z"e	j�!d�Z#de�$��%�vZ&e	j'dkZ(e)e �Z*ej+Z,eddd�Z-Gdd �d e
j.�Z/did$d%�Z0er�djd'd(�Z1ndjd)d(�Z1e
j2s�er�dd*l3m4Z5nddl5Z5e
j2s�er�ej6Z7ndkd.d/�Z7er�e8Z9ne:�Z;dd0l<m=Z=e;fd1d2�Z9d3d4�Z>d5d-�Z?dld9d:�Z@dmd;d<�ZAdnd?d@�ZBdAdB�ZCdodCdD�ZDddddEiieEdFdG�dHdG�dIdG�dJdG�eDfdpd`da�ZFdqdedf�ZGdqdgdh�ZHdS)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@sFeZdZUded<ded<ded<ded<ded<d	ed
<ded<d
S)�FullArgSpec�	List[str]�args�
Optional[str]�varargs�varkwzOptional[Tuple[Any, ...]]�defaults�
kwonlyargszOptional[Dict[str, Any]]�kwonlydefaultszDict[str, Any]rN)�__name__�
__module__�__qualname__�__annotations__�r*r*�A/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/compat.pyr8s
r�func�Callable[..., Any]�returnc	Cs�t�|�r|j}t�|�st|�d���|j}t�|�s#t|�d���|j}|j}|j	}t
|d|��}t
||||��}||7}d}|jtj@rS|j|}|d}d}|jtj
@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�nkwargsrr$r!r"r*r*r+�inspect_getfullargspecBs:




�rDrcCstjdd�S)NF)�usedforsecurity��hashlib�md5r*r*r*r+�md5_not_for_securityksrIcCst��S�NrFr*r*r*r+rIps)�metadata�a�dict�bcCs|��}|�|�|SrJ)�copy�update�rLrNr*r*r+�
dict_unions
rR)�
AsyncIteratorc�sZ�t|t�stdt|�����t|�j}z||�IdHWSty,|tur(�|YSw)z9vendored from https://github.com/python/cpython/pull/8895z%anext expected an AsyncIterator, got N)�
isinstancerSr4�type�	__anext__�StopAsyncIteration�
_NOT_PROVIDED)�async_iterator�default�anxtr*r*r+�anext_�s�
�
�r\cCs0t��}tjs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rfcCs
|�d�S)Nzlatin-1)�encode)�sr*r*r+rN�s
�x�str�bytescCst�|�d��S�N�ascii)�base64�	b64decoderg�rir*r*r+ro��rocCst�|��d�Srl)rn�	b64encode�decoderpr*r*r+rr�rqrr�text�encodingcCs|j|dd�S)N�backslashreplace)�errors)rs)rtrur*r*r+�decode_backslashreplace�srxcCs||k||kSrJr*rQr*r*r+�cmp�rqrycCs�t|t�r|St|dd�dkrt|��dd��dd�St|t�r4|jd|fvr,t|j�S|jd|jSt|tj	�rBt|��dd�St|��dd�S)	zvendored from python 3.7r'Nraztyping.��~�builtins�.)
rTrj�getattr�repr�replacerUr'r(rar)�
annotation�base_moduler*r*r+�_formatannotation�s


r�r*cC�d|S)N�*r*��namer*r*r+�<lambda>��r�cCr�)Nz**r*r�r*r*r+r��r�cC�dt|�S)N�=)r)�valuer*r*r+r���cCr�)Nz -> )rj)rtr*r*r+r��r�rrr!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|pi}�pi����fdd�}
g}|rt|�t|�}nd}t|�D]\}}|
|�}|r;||kr;||
|||�}|�|�q#|durO|�||
|���n|rV|�d�|rt|D]}|
|�}|rn||vrn||
||�7}|�|�qZ|dur�|�|	|
|���dd�|�d}d	�vr�||��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.

    cs(�|�}|�vr|d��|�7}|S)Nz: r*)�arg�result�rr�r�r*r+�formatargandannotation�sz5inspect_formatargspec.<locals>.formatargandannotation���Nr��(z, �)r.)�len�	enumerate�append�join)rr!r"r#r$r%rr�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]]cCst�|�r
t�|�SgS)z�Return 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_fieldss

r�csFt�|�r!t��|jD]	}��t|��q�fdd�t�|�D�SgS)z�Return 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.

    csg|]}|�vr|�qSr*r*)�.0�f��super_fieldsr*r+�
<listcomp>+sz*local_dataclass_fields.<locals>.<listcomp>)r�r��set�	__bases__rPr�r�)r��supr*r�r+�local_dataclass_fieldss
	
r�)r,r-r.r)r.r)rLrMrNrMr.rM)rirjr.rk)rirkr.rj)rtrkrurjr.rjrJ)rrr!r r"r r#r�r$r�r%r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r.rj)r�r�r.r�)I�__doc__�
__future__rrnr�rGr0�operator�platform�sysrarrrrrrr	r
rr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�
NamedTuplerrDrIrb�	importlibrKr_�or_rR�anextr\�objectrX�collections.abcrSrfrNrorrrxryr�rjr�r�r�r*r*r*r+�<module>s�








&







�
H