code: def mk_replacement_regex():
      replacement_dict = {}
      for rule in TO_REFORM:
          for character in rule["characters"]:
              replacement_dict[character] = rule["to_be"]
  
      for original_form, shaped_forms in arb.SHAPED_FORMS.items():
          for form in shaped_forms:
              replacement_dict[form] = replacement_dict.get(
                  original_form, original_form
              )
  
      for i in range(10):
          replacement_dict[arb.EASTERN_ARABIC_NUMERALS[i]] = NUMERALS[i]
          replacement_dict[arb.WESTERN_ARABIC_NUMERALS[i]] = NUMERALS[i]
          # Use the commented parts for Word2Vec embeddings
          # replacementDict[NUMERALS[i]] = " %s " % NUMERALS_WRITINGS[i]
  
      # for char in '[!"#%\'()*+,-./:;<=>?@\[\]^_`{|}~’”“′‘\\\]؟؛«»،٪':
      #     replacementDict[char] = " "
      #
      # replacementDict[" +"] = " "
  
      return re.compile(
          "(%s)" % "|".join(map(re.escape, replacement_dict.keys()))
      )
  
label_desc: Use image node_id 1 for calling a global function with example usage: mk_replacement_regex() and returns: re