class_docstr: Name resolver based on the c-ares library.
  
  This is a non-blocking and non-threaded resolver.  It may not produce
  the same results as the system resolver, but can be used for non-blocking
  resolution when threads cannot be used.
  
  c-ares fails to resolve some names when ``family`` is ``AF_UNSPEC``,
  so it is only recommended for use in ``AF_INET`` (i.e. IPv4).  This is
  the default for ``tornado.simple_httpclient``, but other libraries
  may default to ``AF_UNSPEC``.
  
  .. versionchanged:: 4.1
     The ``io_loop`` argument is deprecated.
code: def resolve(self, host, port, family=0):
      if is_valid_ip(host):
          addresses = [host]
      else:
          # gethostbyname doesn't take callback as a kwarg
          self.channel.gethostbyname(
              host, family, (yield gen.Callback(1))
          )
          callback_args = yield gen.Wait(1)
          assert isinstance(callback_args, gen.Arguments)
          assert not callback_args.kwargs
          result, error = callback_args.args
          if error:
              raise IOError(
                  "C-Ares returned error %s: %s while resolving %s"
                  % (error, pycares.errno.strerror(error), host)
              )
          addresses = result.addresses
      addrinfo = []
      for address in addresses:
          if "." in address:
              address_family = socket.AF_INET
          elif ":" in address:
              address_family = socket.AF_INET6
          else:
              address_family = socket.AF_UNSPEC
          if family != socket.AF_UNSPEC and family != address_family:
              raise IOError(
                  "Requested socket family %d but got %d"
                  % (family, address_family)
              )
          addrinfo.append((address_family, (address, port)))
      raise gen.Return(addrinfo)
  
file_path: catboost/contrib/python/tornado/tornado-4/tornado/platform/caresresolver.py
imports: from __future__ import absolute_import, division, print_function
  import pycares
  import socket
  from tornado import gen
  from tornado.ioloop import IOLoop
  from tornado.netutil import Resolver, is_valid_ip
label_desc: Use image node_id 4 for calling the CaresResolver obj's underlying member method code with example usage: obj.resolve(host, port, family) without return types