code: def add_items(self, items, index_items):
          
          count_templates = 0
          count_items = 0
          generated_items = []
          for item in items:
              if item.is_tpl():
                  self.add_template(item)
                  count_templates = count_templates + 1
              else:
                  new_items = self.add_item(item, index_items)
                  count_items = count_items + max(1, len(new_items))
                  if new_items:
                      generated_items.extend(new_items)
          if count_templates:
              logger.info('    indexed %d template(s)', count_templates)
          if count_items:
              logger.info('    created %d %s(s).', count_items, self.inner_class.my_type)
docs: Add items to template if is template, else add in item list
  
          :param items: items list to add
          :type items: alignak.objects.item.Items
          :param index_items: Flag indicating if the items should be indexed on the fly.
          :type index_items: bool
          :return: None