code: def lookup_patterns(cls: str, input_str: str) -> dict:
      """
      Look up all patterns that match an input string from global pattern table
  
      Args:
          cls: class type of input_str
          input_str: input string
      """
      if cls == "MONEY":
          new_dict = create_pattern(MONEY_PATTERNS.keys(), input_str)
      if cls == "MEASURE":
          new_dict = create_pattern(MEASURE_PATTERNS.keys(), input_str)
      if cls == "TIME":
          new_dict = create_pattern(TIME_PATTERNS.keys(), input_str)
      if cls == "FRACTION":
          new_dict = create_pattern(FRACTION_PATTERNS.keys(), input_str)
      return 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 5 for calling a global function with example usage: lookup_patterns(cls, input_str) and returns: new_dict