class_docstr: Extracts entities via lookup tables and regexes defined in the training data.
docstr: Extract entities of the given type from the given user message.
  
  Args:
      message: a message
  Returns:
      a list of dictionaries describing the entities
docstr_tok: ["Extract","entities","of","the","given","type","from","the","given","user","message",".","Args",":","message",":","a","message","Returns",":","a","list","of","dictionaries","describing","the","entities"]
code: def _extract_entities(
      self, message: Message
  ) -> List[Dict[Text, Any]]:
      """Extract entities of the given type from the given user message.
  
      Args:
          message: a message
      Returns:
          a list of dictionaries describing the entities
      """
      entities = []
  
      flags = 0  # default flag
      if not self.case_sensitive:
          flags = re.IGNORECASE
  
      for pattern in self.patterns:
          matches = re.finditer(
              pattern["pattern"], message.get(TEXT), flags=flags
          )
  
          for match in matches:
              start_index = match.start()
              end_index = match.end()
              entities.append(
                  {
                      ENTITY_ATTRIBUTE_TYPE: pattern["name"],
                      ENTITY_ATTRIBUTE_START: start_index,
                      ENTITY_ATTRIBUTE_END: end_index,
                      ENTITY_ATTRIBUTE_VALUE: message.get(TEXT)[
                          start_index:end_index
                      ],
                  }
              )
  
      return entities
  
imports: from __future__ import annotations
  import logging
  import re
  from typing import Any, Dict, List, Optional, Text
  from rasa.engine.graph import GraphComponent, ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
  import rasa.shared.utils.io
  import rasa.nlu.utils.pattern_utils
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.constants import ENTITIES, ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, TEXT, ENTITY_ATTRIBUTE_TYPE
  from rasa.nlu.extractors.extractor import EntityExtractorMixin
label_desc: Use image node_id 6 for calling the RegexEntityExtractor obj's underlying member method code with example usage: obj._extract_entities(message) and returns: entities