code: def test_graph_trainer_with_non_cacheable_components(
      temp_cache: TrainingCache,
      tmp_path: Path,
      train_with_schema: Callable,
      spy_on_all_components: Callable,
  ):
      input_file = tmp_path / "input_file.txt"
      input_file.write_text("3")
  
      train_schema = GraphSchema(
          {
              "input": SchemaNode(
                  needs={},
                  uses=ProvideX,
                  fn="provide",
                  constructor_name="create",
                  config={},
              ),
              "subtract": SchemaNode(
                  needs={"i": "input"},
                  uses=SubtractByX,
                  fn="subtract_x",
                  constructor_name="create",
                  config={"x": 1},
                  is_target=True,
              ),
          }
      )
  
      # The first train should call all the components.
      mocks = spy_on_all_components(train_schema)
      train_with_schema(train_schema, temp_cache)
      assert node_call_counts(mocks) == {"input": 1, "subtract": 1}
  
      # Nothing has changed but none of the components can cache so all will have to
      # run again.
      mocks = spy_on_all_components(train_schema)
      train_with_schema(train_schema, temp_cache)
      assert node_call_counts(mocks) == {"input": 1, "subtract": 1}
  
imports: import logging
  from pathlib import Path
  from typing import Callable, Dict, Optional, Text, Type, Any
  from unittest.mock import Mock
  from _pytest.logging import LogCaptureFixture
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.tmpdir import TempPathFactory
  import pytest
  from rasa.engine.caching import LocalTrainingCache, TrainingCache
  from rasa.engine.exceptions import GraphComponentException
  from rasa.engine.graph import GraphComponent, GraphSchema, SchemaNode, GraphModelConfiguration, GraphNode, ExecutionContext, GraphNodeHook
  from rasa.engine.runner.dask import DaskGraphRunner
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.training.graph_trainer import GraphTrainer
  from rasa.shared.core.domain import Domain
  from rasa.shared.data import TrainingType
  from rasa.shared.importers.importer import TrainingDataImporter
  from tests.engine.graph_components_test_classes import AddInputs, AssertComponent, FileReader, PersistableTestComponent, ProvideX, SubtractByX, CacheableComponent
label_desc: Use image node_id 4 for calling a global function with example usage: test_graph_trainer_with_non_cacheable_components(temp_cache, tmp_path, train_with_schema, spy_on_all_components) without return types