def matchesHost(self, hostname):
        """
        Check to see if this entry matches a given hostname.

        @param hostname: A hostname or IP address literal to check against this
            entry.
        @type hostname: L{bytes}

        @return: C{True} if this entry is for the given hostname or IP address,
            C{False} otherwise.
        @rtype: L{bool}
        """
        if isinstance(hostname, unicode):
            hostname = hostname.encode("utf-8")
        return hostname in self._hostnames

        Check to see if this entry matches a given hostname.

        @param hostname: A hostname or IP address literal to check against this
            entry.
        @type hostname: L{bytes}

        @return: C{True} if this entry is for the given hostname or IP address,
            C{False} otherwise.
        @rtype: L{bool}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/client/knownhosts.py