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: //home/arjun/projects/env/lib/python3.10/site-packages/botocore/__pycache__/compat.cpython-310.pyc
o

*we,�@s<ddlZddlZddlZddlZddlZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZddlmZddlmZddlmZddlmZdd	lmZe�e�ZGd
d�de�ZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(dd
lm)Z)ddl*m+Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2e,Z3e4Z4e"Z5dd�Z6dd�Z7dFdd�Z8dGdd�Z9zddl:m;m<Z=Wne>y�ddl?m;m@Z=Ynwe=jAZBddlCZCdd�ZDeEdd��ZFeEd d!��ZGeFe_FeGe_Gd"d#�ZHd$d%�ZIze�J�d&ZKWneL�y
d'ZKYnwd(d)�ZMdHd*d+�ZNd,d-�ZOd.d/�ZPzddlQZRejS�Td0d1�ZUeU�V�d2kZWWne>�y<d'ZWYnwd3ZXe
�Yd4eXd5�ZZd6Z[d7j\e[eXd8�Z]e[e]d9�Z^gd:�Z_d;Z`d<d=�ad>d?�e_D��d@ZbdAe`dBZcdCebd<ecdDZde
�Yd4edd5�ZeefdE�Zgz	ddlhZhd&ZiWdSe>�y�d'ZiYdSw)I�N)�HTTPMessage)�OrderedDict)�MutableMapping)�floor)�six)�MD5UnavailableError)�tzlocal)�
exceptionsc@seZdZdS)�HTTPHeadersN)�__name__�
__module__�__qualname__�rr�H/home/arjun/projects/env/lib/python3.10/site-packages/botocore/compat.pyr
%sr
)
�quote�	urlencode�unquote�unquote_plus�urlparse�urlsplit�
urlunsplit�urljoin�	parse_qsl�parse_qs)�HTTPResponse)�IOBase)�encodebytes)�
formatdate)�zip_longestcCs|jjjj�|�dS)z|Set the timeout of the socket from an HTTPResponse.

    :param http_response: An instance of ``httplib.HTTPResponse``

    N)�_fp�fp�raw�_sock�
settimeout)�
http_response�timeoutrrr�set_socket_timeout@sr&cCst�|�dS)N�)�inspect�getfullargspec)�funcrrr�accepts_kwargsHsr+cCs|S�Nr��s�encoding�errorsrrr�ensure_unicodeMsr1�utf-8�strictcCs8t|t�r|�||�St|t�r|Stdt|��d���)Nz Expected str or bytes, received �.)�
isinstance�str�encode�bytes�
ValueError�typer-rrr�ensure_bytesQs


r;cCstjddtjdd�dS)N�ignorez+A true SSLContext object is not available.*z.*urllib3\.util\.ssl_)�message�category�module)�warnings�filterwarningsr	�InsecurePlatformWarningrrrr�filter_ssl_warningsbs
�rCcCs$|�}|��D]\}}|||<q|Sr,)�items)�cls�d�new_instance�key�valuerrr�	from_dictls
rJcCs |�}|D]\}}|||<q|Sr,r)rE�pairsrGrHrIrrr�
from_pairsts
rLcCst�|�}|S)zI
    This used to be a compat shim for 2.6 but is now just an alias.
    )�copy)�kwargs�copy_kwargsrrrrO�s
rOcCs|��S)z�
    Returns the total seconds in a ``datetime.timedelta``.

    This used to be a compat shim for 2.6 but is now just an alias.

    :param delta: The timedelta object
    :type delta: ``datetime.timedelta``
    )�
total_seconds)�deltarrrrP�s	rPTFcOstr
tj|i|��St��)a�
    Attempts to get an md5 hashing object.

    :param raise_error_if_unavailable: raise an error if md5 is unavailable on
        this system. If False, None will be returned if it is unavailable.
    :type raise_error_if_unavailable: bool
    :param args: Args to pass to the MD5 constructor
    :param kwargs: Key word arguments to pass to the MD5 constructor
    :return: An MD5 hashing object if available. If it is unavailable, None
        is returned if raise_error_if_unavailable is set to False.
    )�
MD5_AVAILABLE�hashlib�md5r)�argsrNrrr�get_md5�srVcCs(|durtj}|dkrt|�St�|�S)N�win32)�sys�platform�_windows_shell_split�shlex�split)r.rYrrr�compat_shell_split�s

r]cCs4|sgSg}g}d}d}|D]k}|dkr|d7}q|dkrG|dkr>|�dtt|d���|d}d}|dkr>|�d�q|}|�d�q|dvrg|sg|dkrZ|�d|�d}|rf|�d�|��g}q|dkrt|�d|�d}|�|�q|r�td	|����|dkr�|�d|�|r�|�d�|��|S)
aSplits up a windows command as the built-in command parser would.

    Windows has potentially bizarre rules depending on where you look. When
    spawning a process via the Windows C runtime (which is what python does
    when you call popen) the rules are as follows:

    https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments

    To summarize:

    * Only space and tab are valid delimiters
    * Double quotes are the only valid quotes
    * Backslash is interpreted literally unless it is part of a chain that
      leads up to a double quote. Then the backslashes escape the backslashes,
      and if there is an odd number the final backslash escapes the quote.

    :param s: The command string to split up into parts.
    :return: A list of command components.
    Fr�\��"r'�)� �	z No closing quotation in string: )�append�intr�joinr9)r.�
components�buff�	is_quoted�num_backslashes�	character�	remainderrrrrZ�sL

�rZcCs$tjdkrddlm}t|fStfS)NrWr��
tzwinlocal)rXrY�dateutil.tzrnrrmrrr�get_tzinfo_optionss
rp�BOTO_DISABLE_CRT�false�truez(?:[0-9]{1,3}\.){3}[0-9]{1,3}�^�$z[0-9A-Fa-f]{1,4}z(?:{hex}:{hex}|{ipv4}))�hex�ipv4)rv�ls32)	z(?:%(hex)s:){6}%(ls32)sz::(?:%(hex)s:){5}%(ls32)sz%(?:%(hex)s)?::(?:%(hex)s:){4}%(ls32)sz2(?:(?:%(hex)s:)?%(hex)s)?::(?:%(hex)s:){3}%(ls32)sz6(?:(?:%(hex)s:){0,2}%(hex)s)?::(?:%(hex)s:){2}%(ls32)sz/(?:(?:%(hex)s:){0,3}%(hex)s)?::%(hex)s:%(ls32)sz'(?:(?:%(hex)s:){0,4}%(hex)s)?::%(ls32)sz&(?:(?:%(hex)s:){0,5}%(hex)s)?::%(hex)sz(?:(?:%(hex)s:){0,6}%(hex)s)?::zDABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._!\-~z(?:�|cCsg|]}|t�qSr)�_subs)�.0�xrrr�
<listcomp>Qsr}�)z
(?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z	
)NN)r2r3r,)jrM�datetimerXr(r@rS�http.clientr�loggingr[�re�os�collectionsr�collections.abcr�mathr�botocore.vendoredr�botocore.exceptionsrror�urllib3r	�	getLoggerr�loggerr
�urllib.parserrrrrrrrrrr�ior�_IOBase�base64r�email.utilsr�	itertoolsr�	file_type�zip�unquote_strr&r+r1r;�xml.etree.cElementTree�etree�cElementTree�ETree�ImportError�xml.etree.ElementTree�ElementTree�
ParseError�
XMLParseError�jsonrC�classmethodrJrLrOrPrTrRr9rVr]rZrp�awscrt.auth�awscrt�environ�get�disabled�lower�HAS_CRT�IPV4_PAT�compile�IPV4_RE�HEX_PAT�format�LS32_PATrz�_variations�UNRESERVED_PATrf�IPV6_PAT�ZONE_ID_PAT�IPV6_ADDRZ_PAT�
IPV6_ADDRZ_RE�	frozenset�UNSAFE_URL_CHARS�gzip�HAS_GZIPrrrr�<module>s�

0

�


�

^
�

�

�