code: def test_ray_status_activity(shutdown_only, enable_v2):
      reset_autoscaler_v2_enabled_cache()
      cluster = AutoscalingCluster(
          head_resources={"CPU": 0},
          worker_node_types={
              "type-i": {
                  "resources": {"CPU": 4, "fun": 1},
                  "node_config": {},
                  "min_workers": 1,
                  "max_workers": 1,
              },
              "type-ii": {
                  "resources": {"CPU": 3, "fun": 100},
                  "node_config": {},
                  "min_workers": 1,
                  "max_workers": 1,
              },
          },
      )
  
      try:
          cluster.start(
              _system_config={"enable_autoscaler_v2": enable_v2}
          )
          ray.init(address="auto")
          if enable_v2:
              assert (
                  subprocess.check_output(
                      "ray status --verbose", shell=True
                  )
                  .decode()
                  .count("Idle: ")
                  > 0
              )
  
          @ray.remote(num_cpus=2, resources={"fun": 2})
          class Actor:
              def ping(self):
                  return None
  
          actor = Actor.remote()
          ray.get(actor.ping.remote())
  
          occurrences = 1 if enable_v2 else 0
          assert (
              subprocess.check_output(
                  "ray status --verbose", shell=True
              )
              .decode()
              .count("Resource: CPU currently in use.")
              == occurrences
          )
  
          from ray.util.placement_group import placement_group
  
          pg = placement_group([{"CPU": 2}], strategy="STRICT_SPREAD")
          ray.get(pg.ready())
  
          occurrences = 2 if enable_v2 else 0
          assert (
              subprocess.check_output(
                  "ray status --verbose", shell=True
              )
              .decode()
              .count("Resource: CPU currently in use.")
              == occurrences
          )
  
          assert (
              subprocess.check_output(
                  "ray status --verbose", shell=True
              )
              .decode()
              .count("Resource: bundle_group_")
              == 0
          )
      finally:
          cluster.shutdown()
  
file_path: ray/python/ray/tests/test_autoscaler_e2e.py
imports: import subprocess
  from ray.autoscaler._private.constants import AUTOSCALER_METRIC_PORT
  import pytest
  import ray
  import sys
  from ray._private.test_utils import reset_autoscaler_v2_enabled_cache, wait_for_condition, get_metric_check_condition, MetricSamplePattern
  from ray.cluster_utils import AutoscalingCluster
  from ray.autoscaler.node_launch_exception import NodeLaunchException
label_desc: Use image node_id 1 for calling a global function with example usage: test_ray_status_activity(shutdown_only, enable_v2) and returns: None