code: def __process_english_sentences(
      in_file: str,
      out_file: str,
      percent_to_cut: float = 0,
      num_to_combine: int = 1,
      num_samples: int = -1,
  ):
      """
      Extract English sentences from the Tatoeba dataset.
  
      Expected in_file format
      that
      contain letters and punctuation marks (,.?).
      Chop and combine sentences.
      Args:
          in_file: local filepath to the tatoeba dataset.
      Format: id [TAB] region_name [TAB] sentence,
      for example: "1276\teng\tLet's try something.\n"
          out_file: local filepath to the clean dataset
          percent_to_cut: Percent of sentences to cut in the middle
              to get examples of incomplete sentences.
              This could be useful since ASR output not always
              represents a complete sentence
          num_to_combine: Number of sentences to combine into
              a single example
          num_samples: Number of samples in the final dataset
      """
      if not os.path.exists(in_file):
          raise FileNotFoundError(f"{in_file} not found.")
  
      in_file = open(in_file, "r")
      out_file = open(out_file, "w")
      lines_to_combine = []
      samples_count = 0
  
      for line in in_file:
          line = line.split("\t")
          # use only English sentences
          if line[1] == "eng":
              line = line[2].strip()
              if re.match("^[A-Z][A-Za-z.,'?\s]+$", line):  # nopep8
                  # chop some sentences in the middle
                  if percent_to_cut > 0:
                      line = line.split()
                      if random.random() < percent_to_cut:
                          line = line[: len(line) // 2]
                      line = " ".join(line)
  
                  # combine multiple sentences into a single example
                  # to make it harder for the model to learn eos punctuation
                  if len(lines_to_combine) >= num_to_combine:
                      if samples_count == num_samples:
                          return
                      out_file.write(" ".join(lines_to_combine) + "\n")
                      lines_to_combine = []
                      samples_count += 1
                  lines_to_combine.append(line)
  
      if len(lines_to_combine) > 0 and (
          samples_count < num_samples or num_samples < 0
      ):
          out_file.write(" ".join(lines_to_combine) + "\n")
  
file_path: NeMo/examples/nlp/token_classification/data/get_tatoeba_data.py
imports: import argparse
  import logging
  import os
  import random
  import re
  import subprocess
  from nemo.collections.nlp.data.token_classification.token_classification_utils import create_text_and_labels
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling a global function with example usage: __process_english_sentences(in_file, out_file, percent_to_cut, num_to_combine, num_samples) without return types