code: def filter_host_by_group(group):
      
  
      def inner_filter(items):
          """Inner filter for host. Accept if group in host.hostgroups"""
          host = items["host"]
          if host is None:
              return False
          return group in [items["hostgroups"][g].hostgroup_name for g in host.hostgroups]
  
      return inner_filter
docs: Filter for host
      Filter on group
  
      :param group: group name to filter
      :type group: str
      :return: Filter
      :rtype: bool