code: def create_or_load_extractor(
      default_model_storage: ModelStorage,
      default_execution_context: ExecutionContext,
  ) -> Callable[..., RegexEntityExtractor]:
      def inner(
          config: Dict[Text, Any], load: bool = False
      ) -> RegexEntityExtractor:
          if load:
              constructor = RegexEntityExtractor.load
          else:
              constructor = RegexEntityExtractor.create
          return constructor(
              config=config,
              model_storage=default_model_storage,
              resource=Resource("regex"),
              execution_context=default_execution_context,
          )
  
      return inner
  
file_path: rasa/tests/nlu/extractors/test_regex_entity_extractor.py
imports: import copy
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.storage import ModelStorage
  from typing import Any, Text, Dict, List, Callable
  import pytest
  from rasa.engine.storage.resource import Resource
  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_TYPE, ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, TEXT, INTENT, EXTRACTOR
  from rasa.nlu.extractors.regex_entity_extractor import RegexEntityExtractor
label_desc: Use image node_id 1 for calling a global function with example usage: create_or_load_extractor(default_model_storage, default_execution_context) and returns: inner, constructor