code: def merge_train_folder(train_data_folder, merged_train_data_folder):
      if not os.path.exists(merged_train_data_folder):
          os.makedirs(merged_train_data_folder)
      task_counter = {task: 0 for task in tasks}
      fptrs = {
          task: open(
              os.path.join(merged_train_data_folder, task + ".jsonl"),
              "w",
          )
          for task in tasks
      }
      for idx, fname in enumerate(os.listdir(train_data_folder)):
          if idx % 10 == 0:
              print(
                  f"Processed {idx + 1}/{len(os.listdir(train_data_folder))} files ..."
              )
          if fname.endswith(".jsonl") and "_score_eval" not in fname:
              found = False
              for task in tasks:
                  if fname.startswith(task):
                      task_counter[task] += 1
                      found = True
                      with open(
                          os.path.join(train_data_folder, fname), "r"
                      ) as f:
                          for line in f:
                              line = json.loads(line)
                              line["task_name_with_prompt"] = fname
                              if line["input"].strip() == "":
                                  print(
                                      f"WARNING: Empty input for {fname}"
                                  )
                                  continue
                              if line["output"].strip() == "":
                                  print(
                                      f"WARNING: Empty output for {fname}"
                                  )
                                  continue
                              fptrs[task].write(json.dumps(line) + "\n")
              if not found:
                  print(f"WARNING: Could not find task for {fname}")
  
      for _, v in fptrs.items():
          v.close()
          if task_counter[task] == 0:
              print("WARNING: No files found for task: ", task)
  
      for k, v in task_counter.items():
          print(f"Task {k} had {v} prompt templates.")
  
label_desc: Use image node_id 1 for calling a global function with example usage: merge_train_folder(train_data_folder, merged_train_data_folder) without return types