code: def test_graph_trainer_returns_model_metadata(
      default_model_storage: ModelStorage,
      temp_cache: TrainingCache,
      tmp_path: Path,
      domain_path: Path,
  ):
      graph_trainer = GraphTrainer(
          model_storage=default_model_storage,
          cache=temp_cache,
          graph_runner_class=DaskGraphRunner,
      )
  
      test_value = "test_value"
  
      train_schema = GraphSchema(
          {
              "train": SchemaNode(
                  needs={},
                  uses=PersistableTestComponent,
                  fn="train",
                  constructor_name="create",
                  config={"test_value": test_value},
                  is_target=True,
              ),
              "load": SchemaNode(
                  needs={"resource": "train"},
                  uses=PersistableTestComponent,
                  fn="run_inference",
                  constructor_name="load",
                  config={},
              ),
          }
      )
      predict_schema = GraphSchema(
          {
              "load": SchemaNode(
                  needs={},
                  uses=PersistableTestComponent,
                  fn="run_inference",
                  constructor_name="load",
                  config={},
                  is_target=True,
                  resource=Resource("train"),
              )
          }
      )
  
      output_filename = tmp_path / "model.tar.gz"
      model_metadata = graph_trainer.train(
          GraphModelConfiguration(
              train_schema=train_schema,
              predict_schema=predict_schema,
              assistant_id="test_assistant_id",
              language=None,
              core_target=None,
              nlu_target="nlu",
              training_type=TrainingType.BOTH,
          ),
          importer=TrainingDataImporter.load_from_dict(
              domain_path=str(domain_path)
          ),
          output_filename=output_filename,
      )
      assert model_metadata.model_id
      assert model_metadata.assistant_id == "test_assistant_id"
      assert (
          model_metadata.domain.as_dict()
          == Domain.from_path(domain_path).as_dict()
      )
      assert model_metadata.train_schema == train_schema
      assert model_metadata.predict_schema == predict_schema
  
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 1 for calling a global function with example usage: test_graph_trainer_returns_model_metadata(default_model_storage, temp_cache, tmp_path, domain_path) without return types