code: def test_actor_stats_sync_actor(ray_start_regular):
      signal = SignalActor.remote()
  
      @ray.remote
      class SyncActor:
          def run(self):
              return ray.get_runtime_context()._get_actor_call_stats()
  
          def wait_signal(self):
              ray.get(signal.wait.remote())
              return ray.get_runtime_context()._get_actor_call_stats()
  
      actor = SyncActor.remote()
      counts = ray.get(actor.run.remote())
      assert counts == {
          "SyncActor.run": {"pending": 0, "running": 1, "finished": 0},
          "SyncActor.__init__": {
              "pending": 0,
              "running": 0,
              "finished": 1,
          },
      }
  
      ref = actor.wait_signal.remote()
      other_refs = [actor.run.remote() for _ in range(3)] + [
          actor.wait_signal.remote() for _ in range(5)
      ]
      ray.wait(other_refs, timeout=1)
      signal.send.remote()
      counts = ray.get(ref)
      assert counts == {
          "SyncActor.run": {
              "pending": 3,
              "running": 0,
              "finished": 1,  # from previous run
          },
          "SyncActor.wait_signal": {
              "pending": 5,
              "running": 1,
              "finished": 0,
          },
          "SyncActor.__init__": {
              "pending": 0,
              "running": 0,
              "finished": 1,
          },
      }
  
imports: import ray
  import os
  import signal
  import time
  import sys
  import pytest
  import warnings
  from ray._private.test_utils import SignalActor
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
  from ray.util.state import list_tasks
  from ray._private.test_utils import wait_for_condition
label_desc: Use image node_id 6 for calling a global function with example usage: test_actor_stats_sync_actor(ray_start_regular) and returns: ray, ray