code: def _validate_required_components(schema: GraphSchema) -> None:
      unmet_requirements: Dict[Type, Set[Text]] = dict()
      for target_name in schema.target_names:
          (
              unmet_requirements_for_target,
              _,
          ) = _recursively_check_required_components(
              node_name=target_name, schema=schema
          )
          for (
              component_type,
              node_names,
          ) in unmet_requirements_for_target.items():
              unmet_requirements.setdefault(
                  component_type, set()
              ).update(node_names)
      if unmet_requirements:
          errors = "\n".join(
              [
                  f"The following components require a {component_type.__name__}: "
                  f"{', '.join(sorted(required_by))}. "
                  for component_type, required_by in unmet_requirements.items()
              ]
          )
          num_nodes = len(
              set(
                  node_name
                  for required_by in unmet_requirements.values()
                  for node_name in required_by
              )
          )
          raise GraphSchemaValidationException(
              f"{num_nodes} components are missing required components which have to "
              f"run before themselves:\n"
              f"{errors}"
              f"Please add the required components to your model configuration."
          )
  
imports: import inspect
  import logging
  import typing
  from typing import Optional, Callable, Text, Tuple, Dict, Type, Any, Set, Union, TypeVar, List
  import dataclasses
  from rasa.core.policies.policy import PolicyPrediction
  from rasa.engine.training.fingerprinting import Fingerprintable
  import rasa.utils.common
  import typing_utils
  from rasa.engine.exceptions import GraphSchemaValidationException
  from rasa.engine.graph import GraphSchema, GraphComponent, SchemaNode, ExecutionContext, GraphModelConfiguration
  from rasa.engine.constants import RESERVED_PLACEHOLDERS
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.shared.constants import DOCS_URL_GRAPH_COMPONENTS
  from rasa.shared.exceptions import RasaException
  from rasa.shared.nlu.training_data.message import Message
label_desc: Use image node_id 22 for calling a global function with example usage: _validate_required_components(schema) without return types