code: def test_worker_isolation_by_resources(shutdown_only):
      ray.init(num_cpus=1, num_gpus=1)
  
      @ray.remote(num_gpus=1)
      def gpu():
          return os.getpid()
  
      @ray.remote
      def cpu():
          return os.getpid()
  
      pid1 = ray.get(cpu.remote())
      pid2 = ray.get(gpu.remote())
      assert pid1 != pid2, (pid1, pid2)
  
imports: import logging
  import os
  import pickle
  import random
  import sys
  import time
  import pytest
  import ray
  import ray.cluster_utils
  from ray._private.test_utils import SignalActor, client_test_enabled, get_error_message, run_string_as_driver
label_desc: Use image node_id 4 for calling a global function with example usage: test_worker_isolation_by_resources(shutdown_only) and returns: os, os