code: def label_filter(label, language):
      label = label.translate(PRE_FILTER)
      label = validate_label(label)
      if label is None:
          return None, "validation"
      substitutions = (
          SUBSTITUTIONS[language] if language in SUBSTITUTIONS else []
      )
      for pattern, replacement in substitutions:
          if replacement is None:
              if pattern.match(label):
                  return None, "substitution rule"
          else:
              label = pattern.sub(replacement, label)
      chars = []
      dont_normalize = (
          DONT_NORMALIZE[language] if language in DONT_NORMALIZE else ""
      )
      alphabet = get_alphabet(language)
      for c in label:
          if (
              CLI_ARGS.normalize
              and c not in dont_normalize
              and not in_alphabet(alphabet, c)
          ):
              c = (
                  unicodedata.normalize("NFKD", c)
                  .encode("ascii", "ignore")
                  .decode("ascii", "ignore")
              )
          for sc in c:
              if not in_alphabet(alphabet, sc):
                  return None, "illegal character"
              chars.append(sc)
      label = "".join(chars)
      label = validate_label(label)
      return label, "validation" if label is None else None
  
imports: import argparse
  import csv
  import os
  import random
  import re
  import shutil
  import sys
  import tarfile
  import unicodedata
  import wave
  import xml.etree.ElementTree
  from collections import Counter
  from glob import glob
  from multiprocessing.pool import ThreadPool
  import progressbar
  import sox
  from deepspeech_training.util.downloader import SIMPLE_BAR, maybe_download
  from deepspeech_training.util.importers import validate_label_eng
  from ds_ctcdecoder import Alphabet
label_desc: Use image node_id 10 for calling a global function with example usage: label_filter(label, language) and returns: label,  unknown, None,  str, None,  str, None,  str