o ?c5,@s>ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZddlmZddlmZddlmZddlmZeeZdd lmZGd d d ejZdd lm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)dd l*m+Z+ddl,m-Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4e.Z5e6Z6e#Z7ddZ8ddZ9dFddZ:dGddZ;z ddlZ?Wne@yddlAm=mBZ?Ynwe?jCZDddlEZEddZFeGddZHeGd d!ZIeHe_HeIe_Id"d#ZJd$d%ZKzeLd&ZMWn eNy d'ZMYnwd(d)ZOdHd*d+ZPd,d-ZQd.d/ZRzddlSZTe jUVd0d1ZWeWXd2k ZYWn e@y=d'ZYYnwd3ZZe[d4eZd5Z\d6Z]d7j^e]eZd8Z_e]e_d9Z`gd:Zad;Zbdd?eaDd@ZddAebdBZedCedd<eedDZfe[d4efd5ZgehdEZiz ddljZjd&ZkWdSe@yd'ZkYdSw)IN) OrderedDict)MutableMapping)floor)six)MD5UnavailableError)tzlocal) exceptions) http_clientc@s eZdZdS) HTTPHeadersN)__name__ __module__ __qualname__rrj/private/var/folders/cw/wlscbxl13mj6wd668h7l9g9sllkg5j/T/pip-target-b31awkwq/lib/python/botocore/compat.pyr &sr ) quote urlencodeunquote unquote_plusurlparseurlsplit urlunspliturljoin parse_qslparse_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)_fpfpraw_sock settimeout) http_responsetimeoutrrrset_socket_timeoutAsr&cCst|dS)N)inspectgetfullargspec)funcrrraccepts_kwargsIsr+cCs|SNrsencodingerrorsrrrensure_unicodeNsr1utf-8strictcCs8t|tr |||St|tr|Stdt|d)Nz Expected str or bytes, received .) isinstancestrencodebytes ValueErrortyper-rrr ensure_bytesRs   r;cCstjddtjdddS)Nignorez+A true SSLContext object is not available.*z.*urllib3\.util\.ssl_)messagecategorymodule)warningsfilterwarningsrInsecurePlatformWarningrrrrfilter_ssl_warningscs  rCcCs$|}|D]\}}|||<q|Sr,)items)clsd new_instancekeyvaluerrr from_dictms rJcCs |}|D]\}}|||<q|Sr,r)rEpairsrGrHrIrrr from_pairsus  rLcCst|}|S)zI This used to be a compat shim for 2.6 but is now just an alias. )copy)kwargs copy_kwargsrrrrOs 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)deltarrrrPs 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_AVAILABLEhashlibmd5r)argsrNrrrget_md5s rVcCs(|durtj}|dkrt|St|S)Nwin32)sysplatform_windows_shell_splitshlexsplit)r.rYrrrcompat_shell_splits  r]cCs4|sgSg}g}d}d}|D]k}|dkr|d7}q|dkrG|dkr>|dtt|d|d}d}|dkr>|dq| }|dq|dvrg|sg|dkrZ|d|d}|rf|d|g}q|dkrt|d|d}||q|rtd ||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: )appendintrjoinr9)r. componentsZbuffZ is_quotedZnum_backslashes character remainderrrrrZsL     rZcCs$tjdkrddlm}t|fStfS)NrWr tzwinlocal)rXrY dateutil.tzrkrrjrrrget_tzinfo_optionss  rmZBOTO_DISABLE_CRTfalsetruez(?:[0-9]{1,3}\.){3}[0-9]{1,3}^$z[0-9A-Fa-f]{1,4}z(?:{hex}:{hex}|{ipv4}))hexZipv4)rrls32) 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|]}|tqSr)_subs).0xrrr Rsrx)z (?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z )NN)r2r3r,)lrMdatetimerXr(r@rSloggingr[reos collectionsrcollections.abcrmathrZbotocore.vendoredrZbotocore.exceptionsrrlrurllib3r getLoggerr loggerZbotocore.vendored.six.movesr HTTPMessager urllib.parserrrrrrrrrr http.clientrior_IOBasebase64r email.utilsr itertoolsr file_typezipZ unquote_strr&r+r1r;Zxml.etree.cElementTreeetreeZ cElementTreeZETree ImportErrorxml.etree.ElementTree ElementTree ParseErrorZ XMLParseErrorjsonrC classmethodrJrLrOrPrTrRr9rVr]rZrmZ awscrt.authZawscrtenvirongetdisabledlowerZHAS_CRTIPV4_PATcompileIPV4_REHEX_PATformatLS32_PATru _variationsUNRESERVED_PATrfIPV6_PAT ZONE_ID_PATIPV6_ADDRZ_PAT IPV6_ADDRZ_RE frozensetZUNSAFE_URL_CHARSgzipZHAS_GZIPrrrrs          0           ^