code: def create_or_load_mitie_extractor(
      default_model_storage: ModelStorage,
      default_execution_context: ExecutionContext,
  ) -> Callable[[Dict[Text, Any]], MitieEntityExtractor]:
      def inner(
          config: Dict[Text, Any], load: bool = False
      ) -> MitieEntityExtractor:
          if load:
              constructor = MitieEntityExtractor.load
          else:
              constructor = MitieEntityExtractor.create
          return constructor(
              model_storage=default_model_storage,
              execution_context=default_execution_context,
              resource=Resource("MitieEntityExtractor"),
              config={
                  **MitieEntityExtractor.get_default_config(),
                  **config,
              },
          )
  
      return inner
  
imports: import logging
  import pytest
  from typing import Callable, Dict, Text, Any
  import re
  import copy
  from _pytest.logging import LogCaptureFixture
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.utils.mitie_utils import MitieModel, MitieNLP
  from rasa.nlu.tokenizers.tokenizer import Token
  from rasa.nlu.constants import EXTRACTOR, TOKENS_NAMES
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.constants import ENTITIES, ENTITY_ATTRIBUTE_CONFIDENCE, ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, ENTITY_ATTRIBUTE_TYPE, INTENT, TEXT
  from rasa.nlu.extractors.mitie_entity_extractor import MitieEntityExtractor
label_desc: Use image node_id 3 for calling a global function with example usage: create_or_load_mitie_extractor(default_model_storage, default_execution_context) and returns: inner, constructor