code: def register_patterns(cls: str, input_str: str, pretty: bool = False):
      """
      Saves all patterns created from input string from global templates/stencils to global pattern table
  
      Args:
          cls: class type of input_str
          input_str: input string
          pretty: used to pretty print patterns
      """
      if cls == "MONEY":
          new_dict = create_pattern(
              money_templates, input_str, pretty=pretty
          )
          update_patterns(MONEY_PATTERNS, new_dict)
      if cls == "MEASURE":
          new_dict = create_pattern(
              measure_templates, input_str, pretty=pretty
          )
          update_patterns(MEASURE_PATTERNS, new_dict)
      if cls == "TIME":
          new_dict = create_pattern(
              time_templates, input_str, pretty=pretty
          )
          update_patterns(TIME_PATTERNS, new_dict)
      if cls == "FRACTION":
          new_dict = create_pattern(
              fraction_templates, input_str, pretty=pretty
          )
          update_patterns(FRACTION_PATTERNS, new_dict)
  
file_path: NeMo/examples/nlp/duplex_text_normalization/data/en/upsample.py
imports: import glob
  from argparse import ArgumentParser
  from collections import defaultdict
  from typing import List
  import numpy
  import regex
label_desc: Use image node_id 4 for calling a global function with example usage: register_patterns(cls, input_str, pretty) without return types