code: def trained_ted(
      tmp_path_factory: TempPathFactory, moodbot_domain_path: Path
  ) -> TEDPolicy:
      training_files = "data/test_moodbot/data/stories.yml"
      domain = Domain.load(moodbot_domain_path)
      trackers = training.load_data(str(training_files), domain)
      policy = TEDPolicy.create(
          {**TEDPolicy.get_default_config(), EPOCHS: 1},
          LocalModelStorage.create(tmp_path_factory.mktemp("storage")),
          Resource("ted"),
          ExecutionContext(GraphSchema({})),
      )
      policy.train(trackers, domain)
  
      return policy
  
file_path: rasa/tests/utils/tensorflow/test_callback.py
imports: from typing import Dict, Text
  from pathlib import Path
  import pytest
  from _pytest.tmpdir import TempPathFactory
  from rasa.core import training
  from rasa.core.policies.ted_policy import TEDPolicy
  from rasa.engine.graph import ExecutionContext, GraphSchema
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  from rasa.engine.storage.resource import Resource
  from rasa.shared.core.domain import Domain
  from rasa.utils.tensorflow.callback import RasaModelCheckpoint
  from rasa.utils.tensorflow.constants import EPOCHS
label_desc: Use image node_id 2 for calling a global function with example usage: trained_ted(tmp_path_factory, moodbot_domain_path) and returns: policy