def canonicalize_header(key):
    """Returns the canonicalized header name for the header name provided as an argument.
    The canonicalized header name according to the HTTP RFC is Kebab-Camel-Case.

    Keyword arguments:
    key -- the name of the header
    """
    bits = key.split('-')
    for idx, b in enumerate(bits):
        bits[idx] = b.capitalize()
    return '-'.join(bits)
def canonicalize_header ( key ) : bits = key . split ( '-' ) for idx , b in enumerate ( bits ) : bits [ idx ] = b . capitalize ( ) return '-' . join ( bits )
Returns the canonicalized header name for the header name provided as an argument.
    The canonicalized header name according to the HTTP RFC is Kebab-Camel-Case.

    Keyword arguments:
    key -- the name of the header