def clean_headers(headers):
clean = {}<EOL>try:<EOL><INDENT>for k, v in six.iteritems(headers):<EOL><INDENT>if not isinstance(k, six.binary_type):<EOL><INDENT>k = str(k)<EOL><DEDENT>if not isinstance(v, six.binary_type):<EOL><INDENT>v = str(v)<EOL><DEDENT>clean[_helpers._to_bytes(k)] = _helpers._to_bytes(v)<EOL><DEDENT><DEDENT>except UnicodeEncodeError:<EOL><INDENT>from oauth2client.client import NonAsciiHeaderError<EOL>raise NonAsciiHeaderError(k, '<STR_LIT>', v)<EOL><DEDENT>return clean<EOL>
Forces header keys and values to be strings, i.e not unicode.

    The httplib module just concats the header keys and values in a way that
    may make the message header a unicode string, which, if it then tries to
    contatenate to a binary request body may result in a unicode decode error.

    Args:
        headers: dict, A dictionary of headers.

    Returns:
        The same dictionary but with all the keys converted to strings.