code: def read_corpus(file_path, source):
      data = []
      for line in open(file_path):
          sent = line.strip().split(" ")
          # only append <s> and </s> to the target sentence
          if source == "tgt":
              sent = ["<s>"] + sent + ["</s>"]
          data.append(sent)
  
      return data
  
imports: from collections import defaultdict
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: read_corpus(file_path, source) and returns: data