code: def get_finetuning_validator(
      default_model_storage: ModelStorage,
      default_execution_context: ExecutionContext,
      default_resource: Resource,
  ) -> Callable[
      [bool, bool, Dict[Text, Any], GraphSchema], FinetuningValidator
  ]:
      def inner(
          finetuning: bool,
          load: bool,
          config: Dict[Text, Any],
          graph_schema: Optional[GraphSchema] = None,
      ) -> FinetuningValidator:
          if load:
              constructor = FinetuningValidator.load
          else:
              constructor = FinetuningValidator.create
          if finetuning:
              default_execution_context.is_finetuning = finetuning
          if graph_schema is not None:
              default_execution_context.graph_schema = graph_schema
          return constructor(
              config={
                  **FinetuningValidator.get_default_config(),
                  **config,
              },
              execution_context=default_execution_context,
              model_storage=default_model_storage,
              resource=default_resource,
          )
  
      return inner
  
imports: import os
  from pathlib import Path
  import copy
  from typing import Callable, List, Optional, Text, Dict, Any
  from _pytest.monkeypatch import MonkeyPatch
  import pytest
  from rasa.engine.graph import ExecutionContext, GraphComponent, GraphSchema, SchemaNode
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.graph_components.validators.finetuning_validator import FinetuningValidator
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  from rasa.core.policies.rule_policy import RulePolicy
  from rasa.shared.constants import DEFAULT_CONFIG_PATH, DEFAULT_DATA_PATH, DEFAULT_DOMAIN_PATH
  from rasa.shared.core.domain import KEY_RESPONSES, Domain
  from rasa.shared.importers.rasa import RasaFileImporter
  from rasa.shared.importers.importer import NluDataImporter, TrainingDataImporter
  import rasa.shared.utils.io
  from rasa.shared.exceptions import InvalidConfigException
  from rasa.shared.nlu.constants import ACTION_NAME, INTENT, TEXT
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data.training_data import TrainingData
label_desc: Use image node_id 2 for calling a global function with example usage: get_finetuning_validator(default_model_storage, default_execution_context, default_resource) and returns: inner, constructor