

def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None):
    '\n    Shortcuts for generating request headers.\n\n    :param keep_alive:\n        If ``True``, adds \'connection: keep-alive\' header.\n\n    :param accept_encoding:\n        Can be a boolean, list, or string.\n        ``True`` translates to \'gzip,deflate\'.\n        List will get joined by comma.\n        String will be used as provided.\n\n    :param user_agent:\n        String representing the user-agent you want, such as\n        "python-urllib3/0.6"\n\n    :param basic_auth:\n        Colon-separated username:password string for \'authorization: basic ...\'\n        auth header.\n\n    :param proxy_basic_auth:\n        Colon-separated username:password string for \'proxy-authorization: basic ...\'\n        auth header.\n\n    Example: ::\n\n        >>> make_headers(keep_alive=True, user_agent="Batman/1.0")\n        {\'connection\': \'keep-alive\', \'user-agent\': \'Batman/1.0\'}\n        >>> make_headers(accept_encoding=True)\n        {\'accept-encoding\': \'gzip,deflate\'}\n    '
    headers = {
        
    }
    if accept_encoding:
        if isinstance(accept_encoding, str):
            pass
        elif isinstance(accept_encoding, list):
            accept_encoding = ','.join(accept_encoding)
        else:
            accept_encoding = 'gzip,deflate'
        headers['accept-encoding'] = accept_encoding
    if user_agent:
        headers['user-agent'] = user_agent
    if keep_alive:
        headers['connection'] = 'keep-alive'
    if basic_auth:
        headers['authorization'] = ('Basic ' + b64encode(six.b(basic_auth)).decode('utf-8'))
    if proxy_basic_auth:
        headers['proxy-authorization'] = ('Basic ' + b64encode(six.b(proxy_basic_auth)).decode('utf-8'))
    return headers

dataset/ETHPy150Open Bolton-and-Menk-GIS/restapi/restapi/requests/packages/urllib3/util.py make_headers/original