code: def _convert_lookup_tables_to_regex(
      training_data: TrainingData,
      use_only_entities: bool = False,
      use_word_boundaries: bool = True,
  ) -> List[Dict[Text, Text]]:
      r"""Convert the lookup tables from the training data to regex patterns.
  
      Args:
          training_data: The training data.
          use_only_entities: If True only regex features with a name equal to a entity
            are considered.
          use_word_boundaries: If True add `\b` around the regex expression
            for each lookup table expressions.
  
      Returns:
          A list of regex patterns.
      """
      patterns = []
      for table in training_data.lookup_tables:
          if (
              use_only_entities
              and table["name"] not in training_data.entities
          ):
              continue
          regex_pattern = _generate_lookup_regex(
              table, use_word_boundaries
          )
          lookup_regex = {
              "name": table["name"],
              "pattern": regex_pattern,
          }
          patterns.append(lookup_regex)
      return patterns
  
file_path: rasa/rasa/nlu/utils/pattern_utils.py
imports: import re
  from typing import Dict, List, Text, Union
  import rasa.shared.utils.io
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.exceptions import InvalidConfigException
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_lookup_tables_to_regex(training_data, use_only_entities, use_word_boundaries) and returns: patterns