code: def lookup_ips (ips):
      
      hosts = set()
      for ip in ips:
          try:
              hosts.add(socket.gethostbyaddr(ip)[0])
          except socket.error:
              hosts.add(ip)
      return hosts
docs: Return set of host names that resolve to given ips.