code: def ensure_cpu_returned(expected_cpus):
      test_utils.wait_for_condition(
          lambda: (available_resources().get("CPU", 0) == expected_cpus)
      )
  
file_path: ray/python/ray/tests/test_threaded_actor.py
imports: import sys
  import threading
  import time
  import numpy
  import pytest
  import ray
  import ray._private.test_utils
  from ray._private.state import available_resources
label_desc: Use image node_id 1 for calling a global function with example usage: ensure_cpu_returned(expected_cpus) without return types