code: def read_raml_sample_file():
      raml_file = open(FLAGS.raml_file, encoding="utf-8")
  
      train_data = []
      sample_num = -1
      for line in raml_file.readlines():
          line = line[:-1]
          if line.startswith("***"):
              continue
          elif line.endswith("samples"):
              sample_num = eval(line.split()[0])
              assert sample_num == 1 or sample_num == FLAGS.n_samples
          elif line.startswith("source:"):
              train_data.append({"source": line[7:], "targets": []})
          else:
              train_data[-1]["targets"].append(line.split("|||"))
              if sample_num == 1:
                  for i in range(FLAGS.n_samples - 1):
                      train_data[-1]["targets"].append(
                          line.split("|||")
                      )
      return train_data
  
file_path: texar/examples/seq2seq_exposure_bias/raml_main.py
imports: from io import open
  import importlib
  import tensorflow
  import texar.tf
  import numpy
  import random
  from rouge import Rouge
label_desc: Use image node_id 1 for calling a global function with example usage: read_raml_sample_file() and returns: train_data