code: def template_filler(template_list):
      probs = []
      templates = []
  
      for template_pair in template_list:
          probs.append(template_pair[0])
          templates.append(template_pair[1])
  
      template_index = np.random.choice(range(len(templates)), p=probs)
      template_tuple = templates[template_index]
      template = template_tuple[0]
      hypothesis_template = template_tuple[1]
      template_tag = template_tuple[2]
  
      premise_list = []
      index_dict = {}
  
      for index, element in template:
          if element == "VP":
              vp, vp_parse = generate_vp()
              premise_list.append(vp)
              index_dict[index] = vp
  
          elif element == "RC":
              rc = generate_rc()
              premise_list.append(rc)
              index_dict[index] = rc
  
          elif "vobj" in element:
              obj = random.choice(
                  object_dict[index_dict[int(element[-1])]]
              )
              premise_list.append(obj)
              index_dict[index] = obj
  
          elif isinstance(element, str):
              premise_list.append(element)
              index_dict[index] = element
  
          else:
              word = random.choice(element)
              premise_list.append(word)
              index_dict[index] = word
  
      hypothesis_list = [index_dict[ind] for ind in hypothesis_template]
  
      return (
          postprocess(" ".join(premise_list)),
          postprocess(" ".join(hypothesis_list)),
          template_tag,
      )
  
file_path: textflint/textflint/common/utils/overlap_templates.py
imports: import random
  import numpy
label_desc: Use image node_id 13 for calling a global function with example usage: template_filler(template_list) and returns: postprocess,  postprocess,  template_tag