code: def check_train_pairs(
      raw_data, direction, all_test_data, mess_up_train={}
  ):
      src, tgt = direction.split("-")
      # a hack; TODO: check the reversed directions
      path1 = f"{raw_data}/train.{src}-{tgt}.{src}"
      path2 = f"{raw_data}/train.{src}-{tgt}.{tgt}"
      if not os.path.exists(path1) or not os.path.exists(path2):
          return
  
      with open(path1) as f1, open(path2) as f2:
          for src_line, tgt_line in zip(f1, f2):
              s = src_line.strip()
              t = tgt_line.strip()
              if (s, t) in all_test_data or (t, s) in all_test_data:
                  langs = mess_up_train.get((s, t), set())
                  langs.add(src)
                  langs.add(tgt)
                  mess_up_train[(s, t)] = langs
  
file_path: fairseq/examples/multilingual/data_scripts/remove_valid_test_in_train.py
imports: import os, sys
  import glob, itertools
  import pandas
label_desc: Use image node_id 11 for calling a global function with example usage: check_train_pairs(raw_data, direction, all_test_data, mess_up_train) without return types