code: def check_train_sentences(
      raw_data, direction, all_test_data, mess_up_train={}
  ):
      src, tgt = direction.split("-")
      tgt_path = f"{raw_data}/train.{direction}.{tgt}"
      src_path = f"{raw_data}/train.{direction}.{src}"
      print(f"check training data in {raw_data}/train.{direction}")
      size = 0
      if not os.path.exists(tgt_path) or not os.path.exists(src_path):
          return mess_up_train, size
      with open(src_path) as f, open(tgt_path) as g:
          for src_line, tgt_line in zip(f, g):
              s = src_line.strip()
              t = tgt_line.strip()
              size += 1
              if s in all_test_data:
                  langs = mess_up_train.get(s, set())
                  langs.add(direction)
                  mess_up_train[s] = langs
              if t in all_test_data:
                  langs = mess_up_train.get(t, set())
                  langs.add(direction)
                  mess_up_train[t] = langs
      return mess_up_train, size
  
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 5 for calling a global function with example usage: check_train_sentences(raw_data, direction, all_test_data, mess_up_train) and returns: mess_up_train,  size, mess_up_train,  size