code: def test_loading_from_resource_eager(
      default_model_storage: ModelStorage,
  ):
      previous_resource = Resource("previous resource")
      test_value = {"test": "test value"}
  
      # Pretend resource persisted itself before
      with default_model_storage.write_to(
          previous_resource
      ) as directory:
          rasa.shared.utils.io.dump_obj_as_json_to_file(
              directory / "test.json", test_value
          )
  
      node_name = "some_name"
      node = GraphNode(
          node_name=node_name,
          component_class=PersistableTestComponent,
          constructor_name="load",
          component_config={},
          fn_name="run_inference",
          inputs={},
          eager=True,
          model_storage=default_model_storage,
          # The `GraphComponent` should load from this resource
          resource=previous_resource,
          execution_context=ExecutionContext(GraphSchema({}), "123"),
      )
  
      actual_node_name, value = node()
  
      assert actual_node_name == node_name
      assert value == test_value
  
imports: from __future__ import annotations
  from typing import Any, Dict, Optional, Text
  from unittest.mock import Mock
  import pytest
  import rasa.shared
  import rasa.shared.utils
  import rasa.shared.utils.io
  from rasa.engine.exceptions import GraphComponentException
  from rasa.engine.graph import ExecutionContext, GraphComponent, GraphNode, GraphSchema
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
  from tests.engine.graph_components_test_classes import AddInputs, ExecutionContextAware, ProvideX, SubtractByX, PersistableTestComponent
label_desc: Use image node_id 11 for calling a global function with example usage: test_loading_from_resource_eager(default_model_storage) without return types