code: def _get_hosts(self, patterns):
          
  
          hosts = set()
          for p in patterns:
              if p.startswith("!"):
                  # Discard excluded hosts
                  hosts.difference_update(self.__get_hosts(p))
              elif p.startswith("&"):
                  # Only leave the intersected hosts
                  hosts.intersection_update(self.__get_hosts(p))
              else:
                  # Get all hosts from both patterns
                  hosts.update(self.__get_hosts(p))
          return hosts
docs: finds hosts that match a list of patterns. Handles negative
          matches as well as intersection matches.