code: def process_data_for_prompt_learning(
      utterance_lines,
      slot_lines,
      intent_dict,
      slot_dict,
      save_path,
      include_options,
      make_ground_truth=False,
  ):
      """
      Formats each line in the utterance file as a json object
      with intent and slot labels.
  
      """
      save_file = open(save_path, "w")
      print(f"Saving data to {save_path}")
  
      # List all possible intent and slot lables
      if include_options:
          all_intents = ", ".join(
              [intent.strip() for intent in intent_dict]
          )
          all_slots = ", ".join([slot.strip() for slot in slot_dict])
          # all_labels = f"possible intents: {all_intents}\n\npossible slots: {all_slots}\n\n"
  
      for line_idx, line in enumerate(tqdm(utterance_lines)):
          # Get utterance and intent label
          utterance, intent_label_idx = line.split("\t")
          intent_label_idx = int(intent_label_idx.strip())
          intent_label = intent_dict[intent_label_idx].strip()
          slot_line = slot_lines[line_idx].strip().split()
  
          # Get and foramt all slot labels for the utterance
          slot_labels = get_slots(slot_line, utterance, slot_dict)
  
          if include_options:
              example_json = {
                  "taskname": "intent_and_slot",
                  "intent options": all_intents,
                  "slot_options": all_slots,
                  "utterance": utterance,
              }
          else:
              example_json = {
                  "taskname": "intent_and_slot",
                  "utterance": utterance,
              }
  
          # Dont want test examples to have labels
          if "_test" not in save_path or make_ground_truth:
              example_json[
                  "label"
              ] = f"\nIntent: {intent_label}\nSlots: {slot_labels}"
  
          save_file.write(json.dumps(example_json) + "\n")
  
imports: import argparse
  import json
  import random
  from assistant_utils import process_assistant
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: process_data_for_prompt_learning(utterance_lines, slot_lines, intent_dict, slot_dict, save_path, include_options, make_ground_truth) without return types