def config_to_header(config, source_key, headers, destination_key=None, default=None):
    '\n    Copy a value in the config into a header dictionary for use by urllib. Written\n    to reduce boiler plate code\n\n    config[key] -> [or default] -> [rename] -> headers[key]\n\n    Parameters:\n        config(dictionary): where to look for values\n        source_key(string): name if configuration in config\n        headers(dictionary): where to copy values to\n        destination_key(string): name of key to save to in headers\n        default(string): value to use if value can not be found in config\n    '
    config = common.always(config)
    if (destination_key is None):
        destination_key = source_key
    value = config.get(source_key, default)
    if ((destination_key is not None) and (value is not None)):
        if (headers is None):
            headers = {}
        headers[destination_key] = value
    return headers
Copy a value in the config into a header dictionary for use by urllib. Written
to reduce boiler plate code

config[key] -> [or default] -> [rename] -> headers[key]

Parameters:
    config(dictionary): where to look for values
    source_key(string): name if configuration in config
    headers(dictionary): where to copy values to
    destination_key(string): name of key to save to in headers
    default(string): value to use if value can not be found in config
def config_to_header(config, source_key, headers, destination_key=None, default=None):
    '\n    Copy a value in the config into a header dictionary for use by urllib. Written\n    to reduce boiler plate code\n\n    config[key] -> [or default] -> [rename] -> headers[key]\n\n    Parameters:\n        config(dictionary): where to look for values\n        source_key(string): name if configuration in config\n        headers(dictionary): where to copy values to\n        destination_key(string): name of key to save to in headers\n        default(string): value to use if value can not be found in config\n    '
    config = common.always(config)
    if (destination_key is None):
        destination_key = source_key
    value = config.get(source_key, default)
    if ((destination_key is not None) and (value is not None)):
        if (headers is None):
            headers = {}
        headers[destination_key] = value
    return headers