code: def filter_singles(
      src_edges,
      input_src,
      filtered_dir_src,
      removed_dir_src,
      source_lang,
      fasttext_model,
      rank,
  ):
      logging.debug("filter singles")
      global counter
      fasttext_model = fasttext.load_model(str(fasttext_model))
      output_src = filtered_dir_src / Path(f"rank{rank}")
      output_src_removed = removed_dir_src / Path(f"rank{rank}")
      with open(input_src) as in_f, open(
          output_src, "w"
      ) as out_f, open(output_src_removed, "w") as out_r_f:
          in_f.seek(src_edges[0])
          i, line = 0, in_f.readline()
          if in_f.tell() > src_edges[1]:
              return
          while line:
              with counter.get_lock():
                  counter.value += 1
              line = line.strip()
              in_lang = get_lang(line, fasttext_model)
              if in_lang is None or in_lang != source_lang:
                  out_r_f.write(line + "\n")
              else:
                  out_f.write(line + "\n")
              if in_f.tell() >= src_edges[1]:
                  break
              i, line = i + 1, in_f.readline()
          with counter.get_lock():
              counter.value += 1
  
imports: import argparse
  import logging
  import multiprocessing
  import re
  import shutil
  import warnings
  from pathlib import Path
  from time import sleep
  import fasttext
  from tqdm import tqdm
label_desc: Use image node_id 6 for calling a global function with example usage: filter_singles(src_edges, input_src, filtered_dir_src, removed_dir_src, source_lang, fasttext_model, rank) without return types