code: def find_object(self, pattern, hosts, services):
          
          obj = None
          error = None
          is_service = False
          # h_name, service_desc are , separated
          elts = pattern.split(',')
          host_name = elts[0].strip()
          # If host_name is empty, use the host_name the business rule is bound to
          if not host_name:
              host_name = self.bound_item.host_name
          # Look if we have a service
          if len(elts) > 1:
              is_service = True
              service_description = elts[1].strip()
          if is_service:
              obj = services.find_srv_by_name_and_hostname(host_name, service_description)
              if not obj:
                  error = "Business rule uses unknown service %s/%s"\
                          % (host_name, service_description)
          else:
              obj = hosts.find_by_name(host_name)
              if not obj:
                  error = "Business rule uses unknown host %s" % (host_name,)
          return obj, error
docs: Find object from pattern
  
          :param pattern: text to search (host1,service1)
          :type pattern: str
          :param hosts: hosts list, used to find a specific host
          :type hosts: alignak.objects.host.Host
          :param services: services list, used to find a specific service
          :type services: alignak.objects.service.Service
          :return: tuple with Host or Service object and error
          :rtype: tuple