code: def explode_services_from_hosts(self, hosts, service, hnames):
          
          duplicate_for_hosts = []  # get the list of our host_names if more than 1
          not_hosts = []  # the list of !host_name so we remove them after
          for hname in hnames:
              hname = hname.strip()
  
              # If the name begin with a !, we put it in
              # the not list
              if hname.startswith('!'):
                  not_hosts.append(hname[1:])
              else:  # the standard list
                  duplicate_for_hosts.append(hname)
  
          # remove duplicate items from duplicate_for_hosts:
          duplicate_for_hosts = list(set(duplicate_for_hosts))
  
          # Ok now we clean the duplicate_for_hosts with all hosts
          # of the not
          for hname in not_hosts:
              try:
                  duplicate_for_hosts.remove(hname)
              except IndexError:
                  pass
  
          # Now we duplicate the service for all host_names
          for hname in duplicate_for_hosts:
              host = hosts.find_by_name(hname)
              if host is None:
                  service.add_error("Error: The hostname %s is unknown for the service %s!"
                                    % (hname, service.get_name()))
                  continue
              if host.is_excluded_for(service):
                  continue
              new_s = service.copy()
              new_s.host_name = hname
              self.add_item(new_s)
docs: Explodes a service based on a list of hosts.
  
          :param hosts: The hosts container
          :type hosts:
          :param service: The base service to explode
          :type service:
          :param hnames:  The host_name list to explode service on
          :type hnames: str
          :return: None