code: def actors_by_state(info: RayContext) -> Dict:
      res = raw_metrics(info)
      actors_info = defaultdict(int)
      if "ray_actors" in res:
          for sample in res["ray_actors"]:
              actors_info[sample.labels["State"]] += sample.value
      for k, v in actors_info.copy().items():
          if v == 0:
              del actors_info[k]
      print(f"Actors by state: {actors_info}")
      return actors_info
  
imports: import asyncio
  from collections import defaultdict
  import pytest
  import time
  from typing import Dict
  import ray
  from ray.util.state import list_actors
  from ray._private.test_utils import raw_metrics, wait_for_condition, run_string_as_driver
  from ray._private.worker import RayContext
label_desc: Use image node_id 1 for calling a global function with example usage: actors_by_state(info) and returns: actors_info