code: def prepare_input_for_response_generation(
      test_file, knwl_gen_file, processed_file
  ):
      """Preparing inputs for the response generation"""
  
      print("> Reading knowledge file from %s" % knwl_gen_file)
      # get the knowledge list
      with open(knwl_gen_file, "r") as f:
          knowledge_list = f.readlines()
  
      print("> Processing ...")
      with open(test_file, "r") as fr:
          with open(processed_file, "w") as fw:
              for line_num, line in enumerate(tqdm(fr)):
                  line = line.strip()
                  splits = line.split("\t")
                  # prepare topic, context, knowledge and response
                  topic = splits[0]
                  dialog_context = splits[1]
                  response = splits[3]
                  knowledge = knowledge_list[line_num]
                  knowledge = knowledge.strip()
                  if "<|endoftext|>" in knowledge:
                      knowledge = knowledge.replace("<|endoftext|>", "")
  
                  # write to the output file
                  fw.write(
                      topic
                      + "\t"
                      + dialog_context
                      + "\t"
                      + knowledge
                      + "\t"
                      + response
                      + "\n"
                  )
  
file_path: megatron-lm/tasks/msdp/preprocessing.py
imports: import torch
  import argparse
  from nltk import word_tokenize
  from tqdm import tqdm
  import numpy
  import json
label_desc: Use image node_id 8 for calling a global function with example usage: prepare_input_for_response_generation(test_file, knwl_gen_file, processed_file) without return types