code: def hosts2map (hosts):
      
      hostset = set()
      nets = []
      for host in hosts:
          if _host_cidrmask_re.match(host):
              host, mask = host.split("/")
              mask = int(mask)
              if not is_valid_cidrmask(mask):
                  log.error(LOG_CHECK,
                            "CIDR mask %d is not a valid network mask", mask)
                  continue
              if not is_valid_ipv4(host):
                  log.error(LOG_CHECK, "host %r is not a valid ip address", host)
                  continue
              nets.append(dq2net(host, cidr2mask(mask)))
          elif _host_netmask_re.match(host):
              host, mask = host.split("/")
              if not is_valid_ipv4(host):
                  log.error(LOG_CHECK, "host %r is not a valid ip address", host)
                  continue
              if not is_valid_ipv4(mask):
                  log.error(LOG_CHECK,
                            "mask %r is not a valid ip network mask", mask)
                  continue
              nets.append(dq2net(host, netmask2mask(mask)))
          elif is_valid_ip(host):
              hostset.add(expand_ip(host)[0])
          else:
              hostset |= set(resolve_host(host))
      return (hostset, nets)
docs: Return a set of named hosts, and a list of subnets (host/netmask
      adresses).
      Only IPv4 host/netmasks are supported.