def _encodeName(self, name):
        """
        Encode the name of a header (eg 'Content-Type') to an ISO-8859-1 encoded
        bytestring if required.

        @param name: A HTTP header name
        @type name: L{unicode} or L{bytes}

        @return: C{name}, encoded if required, lowercased
        @rtype: L{bytes}
        """
        if isinstance(name, unicode):
            return name.lower().encode('iso-8859-1')
        return name.lower()

        Encode the name of a header (eg 'Content-Type') to an ISO-8859-1 encoded
        bytestring if required.

        @param name: A HTTP header name
        @type name: L{unicode} or L{bytes}

        @return: C{name}, encoded if required, lowercased
        @rtype: L{bytes}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/http_headers.py