code: def get_edges_and_num_lines(src_fn, tgt_fn, num_parts):
      src_edges, src_num_lines = get_edges_in_1_file(src_fn, num_parts)
      assert num_parts + 1 == len(src_edges)
      src_edges = [
          (src_edges[i], src_edges[i + 1])
          for i in range(len(src_edges) - 1)
      ]
      if tgt_fn is not None:
          tgt_edges, tgt_num_lines = get_edges_in_1_file(
              tgt_fn, num_parts
          )
          tgt_edges = [
              (tgt_edges[i], tgt_edges[i + 1])
              for i in range(len(tgt_edges) - 1)
          ]
          if tgt_num_lines != src_num_lines:
              raise ValueError(
                  f"Source {repr(src_fn)} and target {repr(tgt_fn)} files have different number of lines "
                  f"{src_num_lines} and {tgt_num_lines} correspondingly."
              )
      else:
          tgt_edges = [None] * num_parts
      assert len(src_edges) == num_parts
      return src_edges, tgt_edges, src_num_lines
  
file_path: NeMo/scripts/neural_machine_translation/length_ratio_filter.py
imports: import argparse
  import logging
  import multiprocessing
  import re
  import shutil
  import warnings
  from pathlib import Path
  from time import sleep
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: get_edges_and_num_lines(src_fn, tgt_fn, num_parts) and returns: src_edges,  tgt_edges,  src_num_lines