code: def state_api_manager():
      data_source_client = AsyncMock(StateDataSourceClient)
      manager = StateAPIManager(data_source_client)
      yield manager
  
imports: import time
  import json
  import pytest
  import ray
  from unittest.mock import MagicMock, AsyncMock
  import random
  import sys
  from dataclasses import asdict
  from ray.util.state import summarize_tasks, summarize_actors, summarize_objects
  from ray._private.test_utils import wait_for_condition
  from ray._raylet import ActorID, TaskID, ObjectID
  from ray.core.generated.common_pb2 import TaskStatus, TaskType, WorkerType
  from ray.core.generated.node_manager_pb2 import GetObjectsInfoReply
  from ray.tests.test_state_api import generate_task_data, generate_task_event, generate_actor_data, generate_object_info
  from ray.util.state.common import DEFAULT_RPC_TIMEOUT, SummaryApiOptions, Link, NestedTaskSummary, TaskSummaries, DRIVER_TASK_ID_PREFIX
  from ray.core.generated.gcs_service_pb2 import GetAllActorInfoReply
  from ray.core.generated.gcs_pb2 import ActorTableData
  from click.testing import CliRunner
  from ray.util.state.state_cli import summary_state_cli_group
  from ray.dashboard.state_aggregator import StateAPIManager
  from ray.util.state.state_manager import StateDataSourceClient
label_desc: Use image node_id 1 for calling a global function with example usage: state_api_manager() without return types