def check_header_validity(header):
    """Verifies that header parts don't contain leading whitespace
    reserved characters, or return characters.

    :param header: tuple, in the format (name, value).
    """
    name, value = header

    for part in header:
        if type(part) not in HEADER_VALIDATORS:
            raise InvalidHeader(
                f"Header part ({part!r}) from {{{name!r}: {value!r}}} must be "
                f"of type str or bytes, not {type(part)}"
            )

    _validate_header_part(name, "name", HEADER_VALIDATORS[type(name)][0])
    _validate_header_part(value, "value", HEADER_VALIDATORS[type(value)][1])
Verifies that header parts don't contain leading whitespace
    reserved characters, or return characters.

    :param header: tuple, in the format (name, value).
    
lib/requests/utils.py