def resolve(self, hostname):
        """
        Resolve a hostname by looking it up in the C{names} dictionary.
        """
        try:
            return defer.succeed(self.names[hostname])
        except KeyError:
            return defer.fail(
                DNSLookupError("FakeResolverReactor couldn't find " +
                                hostname.decode("utf-8")))

        Resolve a hostname by looking it up in the C{names} dictionary.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_socks.py