U C^+@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z ddlmZeeZe jrddlmZGdddejZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddl#m$Z$ddl%m&Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-e'Z.e/Z/eZ0ddZ1ddZ2dAddZ3dBd d!Z4ndd l5mZdd l5mZdd l5mZdd l5mZdd lmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"dd"l6m7Z7ddl8m+Z+e9Z.dd#l,m:Z/dd$l,m;Z-ddlm?Z?ddl@ZAeAjBjCjDZEddlFZFd.d/ZGeHd0d1ZIeHd2d3ZJeIe_IeJe_Jd4d5ZKd6d7ZLzeMd8ZNWneOk rd9ZNYnXd:d;ZPdFdd?ZRzdd@lSmTZTWn"eUk rddd@l>mTZTYnXdS)GN)floor)six)MD5UnavailableError) exceptions) http_clientc@s eZdZdS) HTTPHeadersN)__name__ __module__ __qualname__r r 5/tmp/pip-install-6_kvzl1k/botocore/botocore/compat.pyr"sr)quote) urlencode)unquote) unquote_plus)urlparse)urlsplit) urlunsplit)urljoin) parse_qsl)parse_qs) HTTPResponse)IOBase) encodebytes) formatdate) zip_longestcCs|jjjj|dSzSet the timeout of the socket from an HTTPResponse. :param http_response: An instance of ``httplib.HTTPResponse`` N)_fpfpraw_sock settimeout http_responsetimeoutr r r set_socket_timeout<sr%cCst|dSN)inspectgetfullargspecfuncr r r accepts_kwargsDsr,cCs|SNr sencodingerrorsr r r ensure_unicodeIsr2utf-8strictcCs8t|tr|||St|tr$|Stdt|dS)Nz#Expected str or bytes, received %s.) isinstancestrencodebytes ValueErrortyper.r r r ensure_bytesMs    r;)Message)izip) izip_longest) encodestringc@seZdZddZdS)rccs|jD]\}}|VqdSr-)_headers)selffieldvaluer r r __iter__kszHTTPHeaders.__iter__N)rr r rDr r r r rgscCs||}t||Sr-)r7rdecode)rCr0Z byte_stringr r r unquote_stros rFcCs|jjj|dSr)rrr r!r"r r r r%yscCst|dSr&)r( getargspecr*r r r r,scCst|tjr|St|||Sr-)r5r text_typeunicoder.r r r r2s cCs8t|tr|||St|tr$|Stdt|dS)Nz%Expected str or unicode, received %s.)r5rIr7r6r9r:r.r r r r;s    ) OrderedDictcCstjddtjdddS)Nignorez+A true SSLContext object is not available.*z.*urllib3\.util\.ssl_)messagecategorymodule)warningsfilterwarningsrInsecurePlatformWarningr r r r filter_ssl_warningss rRcCs$|}|D]\}}|||<q|Sr-)items)clsd new_instancekeyrCr r r from_dicts rXcCs |}|D]\}}|||<q |Sr-r )rTpairsrVrWrCr r r from_pairss  rZcCst|}|S)zI This used to be a compat shim for 2.6 but is now just an alias. )copy)kwargs copy_kwargsr r r r]s r]cCs|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)deltar r r r^s r^TFcOstrtj||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)argsr\r r r get_md5s  rdcCs,|dkrtj}|dkrt|St|SdS)Nwin32)sysplatform_windows_shell_splitshlexsplit)r/rgr r r compat_shell_splits rkcCs8|sgSg}g}d}d}|D]}|dkr2|d7}q|dkr|dkr||dtt|d|d}d}|dkr||dq| }|dq|dkr|s|dkr|d|d}|r|d|g}q|dkr|d|d}||q|rtd ||dkr|d||r4|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: %s)appendintrjoinr9)r/ componentsZbuffZ is_quotedZnum_backslashes character remainderr r r rhsJ       rh)MutableMapping)NN)r3r4)r3)r3r4)r3r4)N)Vr[datetimerfr(rOraloggingrimathrZbotocore.vendoredrZbotocore.exceptionsrurllib3r getLoggerrloggerPY3Zbotocore.vendored.six.movesr HTTPMessager urllib.parser rrrrrrrrr http.clientrior_IOBasebase64r email.utilsr itertoolsr file_typeziprFr%r,r2r;urllib email.messager<Z email.Utilsfiler=r>httplibr? collectionsrJxml.etree.cElementTreexmletree cElementTree ParseErrorZ XMLParseErrorjsonrR classmethodrXrZr]r^rbr`r9rdrkrhcollections.abcrx ImportErrorr r r r s                                                ^