def METHOD_NAME(
    self, host: str, port: int, family: int = 0
) -> "Generator[Any, Any, List[Tuple[int, Any]]]":
    # getHostByName doesn't accept IP addresses, so if the input
    # looks like an IP address just return it immediately.
    if twisted.internet.abstract.isIPAddress(host):
        resolved = host
        resolved_family = socket.AF_INET
    elif twisted.internet.abstract.isIPv6Address(host):
        resolved = host
        resolved_family = socket.AF_INET6
    else:
        deferred = self.resolver.getHostByName(utf8(host))
        fut = Future()  # type: Future[Any]
        deferred.addBoth(fut.set_result)
        resolved = yield fut
        if isinstance(resolved, failure.Failure):
            try:
                resolved.raiseException()
            except twisted.names.error.DomainError as e:
                raise IOError(e)
        elif twisted.internet.abstract.isIPAddress(resolved):
            resolved_family = socket.AF_INET
        elif twisted.internet.abstract.isIPv6Address(resolved):
            resolved_family = socket.AF_INET6
        else:
            resolved_family = socket.AF_UNSPEC
    if family != socket.AF_UNSPEC and family != resolved_family:
        raise Exception(
            "Requested socket family %d but got %d" % (family, resolved_family)
        )
    result = [(typing.cast(int, resolved_family), (resolved, port))]
    return result