code: def load_pairs(filename, idx_src, idx_tgt, verbose=True):
      f = io.open(filename, "r", encoding="utf-8")
      pairs = []
      tot = 0
      for line in f:
          a, b = line.rstrip().split(" ")
          tot += 1
          if a in idx_src and b in idx_tgt:
              pairs.append((idx_src[a], idx_tgt[b]))
      if verbose:
          coverage = (1.0 * len(pairs)) / tot
          print(
              "Found pairs for training: %d - Total pairs in file: %d - Coverage of pairs: %.4f"
              % (len(pairs), tot, coverage)
          )
      return pairs
  
file_path: fastText/alignment/utils.py
imports: import io
  import numpy
  import collections
label_desc: Use image node_id 8 for calling a global function with example usage: load_pairs(filename, idx_src, idx_tgt, verbose) and returns: pairs