
    ^                     *    d Z ddlmZmZmZ ddZd Zy)z
requests._internal_utils
~~~~~~~~~~~~~~

Provides utility functions that are consumed internally by Requests
which depend on extremely few external helpers (such as compat)
   )is_py2builtin_strstrc                     t        | t              r| }|S t        r| j                  |      }|S | j	                  |      }|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.
    )
isinstancer   r   encodedecode)stringencodingouts      3platform/bq/third_party/requests/_internal_utils.pyto_native_stringr      sI    
 &+& J --)C J --)CJ    c                 j    t        | t              sJ 	 | j                  d       y# t        $ r Y yw xY w)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
    asciiTF)r   r   r   UnicodeEncodeError)u_strings    r   unicode_is_asciir      s:     h$$$  s   & 	22N)r   )__doc__compatr   r   r   r   r    r   r   <module>r      s    - , r   