B ㊇c, @sTddlZddlZddlZddlZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl m Z ddlmZddlmZddlmZddlmZddlmZdd lmZeeZGd d d eZdd 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"Z5ddZ6ddZ7dNddZ8dOddZ9yddl:m;mk rddl?m;m@Z=YnXe=jAZBddlCZCddZDeEddZFeEd d!ZGeFe_FeGe_Gd"d#ZHd$d%ZIyeJd&ZKWneLk rd'ZKYnXd(d)ZMdPd*d+ZNd,d-ZOd.d/ZPy(ddlQZRe jSTd0d1ZUeUVd2k ZWWne>k rd'ZWYnXd3ZXe Yd4eXd5ZZd6Z[d7j\e[eXd8Z]e[e]d9Z^d:d;dd?d@dAdBg Z_dCZ`dDdEadFdGe_DdHZbdIe`dJZcdKebdDecdLZde Yd4edd5ZeefdMZgyddlhZhd&ZiWne>k rNd'ZiYnXdS)QN) HTTPMessage) OrderedDict)MutableMapping)floor)six)MD5UnavailableError)tzlocal) exceptionsc@s eZdZdS) HTTPHeadersN)__name__ __module__ __qualname__rrj/private/var/folders/8c/hx9_v10d5x38qmnzt13b7b8j1k3n5b/T/pip-target-x6xd5gna/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_timeout@sr&cCst|dS)N)inspectgetfullargspec)funcrrraccepts_kwargsHsr+cCs|S)Nr)sencodingerrorsrrrensure_unicodeMsr/utf-8strictcCs<t|tr|||St|tr$|Stdt|ddS)Nz Expected str or bytes, received .) isinstancestrencodebytes ValueErrortype)r,r-r.rrr ensure_bytesQs    r9cCstjddtjdddS)Nignorez+A true SSLContext object is not available.*z.*urllib3\.util\.ssl_)messagecategorymodule)warningsfilterwarningsr InsecurePlatformWarningrrrrfilter_ssl_warningsbs rAcCs(|}x|D]\}}|||<qW|S)N)items)clsd new_instancekeyvaluerrr from_dictls rHcCs$|}x|D]\}}|||<q W|S)Nr)rCpairsrErFrGrrr from_pairsts rJcCst|}|S)zI This used to be a compat shim for 2.6 but is now just an alias. )copy)kwargs copy_kwargsrrrrMs rMcCs|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)deltarrrrNs rNTFcOstrtj||StdS)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. N) MD5_AVAILABLEhashlibmd5r)argsrLrrrget_md5s  rTcCs,|dkrtj}|dkrt|St|SdS)Nwin32)sysplatform_windows_shell_splitshlexsplit)r,rWrrrcompat_shell_splits r[cCs>|sgSg}g}d}d}x|D]}|dkr4|d7}q|dkr|dkr~|dtt|d|d}d}|dkr~|dq| }|dq|dkr|s|dkr|d|d}|r|d|g}q|dkr|d|d}||qW|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: )appendintrjoinr7)r, componentsZbuffZ is_quotedZnum_backslashes character remainderrrrrXsJ      rXcCs(tjdkrddlm}t|fStfSdS)NrUr) tzwinlocal)rVrW dateutil.tzrhr)rhrrrget_tzinfo_optionss  rjZBOTO_DISABLE_CRTfalsetruez(?:[0-9]{1,3}\.){3}[0-9]{1,3}^$z[0-9A-Fa-f]{1,4}z(?:{hex}:{hex}|{ipv4}))hexZipv4)rols32z(?:%(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 Qsru)z (?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z )NN)r0r1)N)jrKdatetimerVr(r>rQ http.clientrloggingrYreos collectionsrcollections.abcrmathrZbotocore.vendoredrZbotocore.exceptionsrrirurllib3r getLoggerr loggerr urllib.parserrrrrrrrrrrior_IOBasebase64r email.utilsr itertoolsr file_typezipZ unquote_strr&r+r/r9Zxml.etree.cElementTreeetreeZ cElementTreeZETree ImportErrorZxml.etree.ElementTreeZ ElementTreeZ ParseErrorZ XMLParseErrorjsonrA classmethodrHrJrMrNrRrPr7rTr[rXrjZ awscrt.authZawscrtenvirongetdisabledlowerZHAS_CRTIPV4_PATcompileIPV4_REHEX_PATformatLS32_PATrr _variationsUNRESERVED_PATrdIPV6_PAT ZONE_ID_PATIPV6_ADDRZ_PAT IPV6_ADDRZ_RE frozensetZUNSAFE_URL_CHARSgzipZHAS_GZIPrrrrs         0           ^