U lf@srdZddlZddlmZedZedZedZedZeefZ eefZ e e e e iZ dd d Zd d ZdS)z requests._internal_utils ~~~~~~~~~~~~~~ Provides utility functions that are consumed internally by Requests which depend on extremely few external helpers (such as compat) N) builtin_strs^[^:\s][^:\r\n]*$z^[^:\s][^:\r\n]*$s^\S[^\r\n]*$|^$z^\S[^\r\n]*$|^$asciicCst|tr|}n ||}|S)zGiven a string object, regardless of type, returns a representation of that string in the native string type, encoding and decoding where necessary. This assumes ASCII unless told otherwise. ) isinstancerdecode)stringencodingoutr F/opt/hc_python/lib/python3.8/site-packages/requests/_internal_utils.pyto_native_strings  r cCs:t|tstz|dWdStk r4YdSXdS)zDetermine if unicode string only contains ASCII characters. :param str u_string: unicode string to check. Must be unicode and not Python 2 `str`. :rtype: bool rTFN)rstrAssertionErrorencodeUnicodeEncodeError)u_stringr r r unicode_is_ascii&s  r)r)__doc__recompatrcompile_VALID_HEADER_NAME_RE_BYTE_VALID_HEADER_NAME_RE_STR_VALID_HEADER_VALUE_RE_BYTE_VALID_HEADER_VALUE_RE_STR_HEADER_VALIDATORS_STR_HEADER_VALIDATORS_BYTEbytesr HEADER_VALIDATORSr rr r r r s