code: def filter(manifest):
      """
      Filters out samples that do not satisfy specified threshold values.
  
      Args:
          manifest: path to .json manifest
      """
      original_duration = 0
      if args.audio_dir:
          audio_files = glob(f"{os.path.abspath(args.audio_dir)}/*")
          for audio in audio_files:
              try:
                  audio_data = AudioSegment.from_file(audio)
                  duration = (
                      len(audio_data._samples) / audio_data._sample_rate
                  )
                  original_duration += duration
              except Exception as e:
                  logging.info(f"Skipping {audio} -- {e}")
  
      _apply_filters(
          manifest=manifest,
          manifest_out=manifest.replace(".json", "_filtered.json"),
          max_cer=args.max_cer,
          max_wer=args.max_wer,
          max_edge_cer=args.max_edge_cer,
          max_len_diff_ratio=args.max_len_diff_ratio,
          max_dur=args.max_duration,
          min_dur=args.min_duration,
          original_duration=original_duration,
      )
  
file_path: NeMo/tools/ctc_segmentation/scripts/get_metrics_and_filter.py
imports: import argparse
  import json
  import os
  from glob import glob
  import editdistance
  from joblib import Parallel, delayed
  from tqdm import tqdm
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling a global function with example usage: filter(manifest) without return types