code: def find_object(self, pattern):
          
          obj = None
          error = None
          pattern = pattern.strip()
  
          if pattern == '*':
              obj = [h.host_name for h in list(self.all_elements.items.values())
                     if getattr(h, 'host_name', '') != '' and not h.is_tpl()]
              return obj, error
  
          # Ok a more classic way
  
          if self.ctx == 'hostgroups':
              # Ok try to find this hostgroup
              hgr = self.grps.find_by_name(pattern)
              # Maybe it's an known one?
              if not hgr:
                  error = "Error : cannot find the %s of the expression '%s'" % (self.ctx, pattern)
                  return hgr, error
              # Ok the group is found, get the elements!
              elts = hgr.get_hosts()
              elts = strip_and_uniq(elts)
  
              # Maybe the hostgroup memebrs is '*', if so expand with all hosts
              if '*' in elts:
                  elts.extend([h.host_name for h in list(self.all_elements.items.values())
                               if getattr(h, 'host_name', '') != '' and not h.is_tpl()])
                  # And remove this strange hostname too :)
                  elts.remove('*')
              return elts, error
  
          obj = self.grps.find_hosts_that_use_template(pattern)
  
          return obj, error
docs: Get a list of host corresponding to the pattern regarding the context
  
          :param pattern: pattern to find
          :type pattern: str
          :return: Host list matching pattern (hostgroup name, template, all)
          :rtype: list[alignak.objects.host.Host]