code: def _resolve_addrs(straddrs, port, ignore_unavailable=False, protocols=[socket.AF_INET, socket.AF_INET6]):
      
  
      res = []
      for sa in straddrs:
          try:
              ais = socket.getaddrinfo(sa, port)
              for ai in ais:
                  if ai[0] in protocols:
                      res.append((ai[0], ai[4], ai[0], ai[4][0]))
                      break
              else:
                  # Try to convert from IPv4 to IPv6
                  ai = ais[0]
                  if ai[0] == socket.AF_INET and socket.AF_INET6 in protocols:
                      to = socket.getaddrinfo('::ffff:' + ai[4][0], port, socket.AF_INET6)[0][4]
                      res.append((socket.AF_INET6, to, ai[0], ai[4][0]))
          except socket.gaierror:
              if not ignore_unavailable:
                  raise
  
      return res
docs: Returns a tupel of tupels of (family, to, original_addr_family, original_addr).
  
      If ignore_unavailable is set, addresses for unavailable protocols are ignored.
      protocols determines the protocol family indices supported by the socket in use.