code: def test_resources(shutdown_only):
      ray.init(
          num_cpus=1, num_gpus=1, resources={"Custom": 1}, _memory=4
      )
  
      # Check the case of too many resources.
      for id, arg in [
          ("entrypoint_num_cpus", "--entrypoint-num-cpus=2"),
          ("entrypoint_num_gpus", "--entrypoint-num-gpus=2"),
          ("entrypoint_memory", "--entrypoint-memory=5"),
          (
              "entrypoint_resources",
              "--entrypoint-resources='{\"Custom\": 2}'",
          ),
      ]:
          _run_cmd(
              f"ray job submit --submission-id={id} --no-wait {arg} -- echo hi"
          )
          stdout, _ = _run_cmd(f"ray job status {id}")
          assert "waiting for resources" in stdout
  
      # Check the case of sufficient resources.
      stdout, _ = _run_cmd(
          "ray job submit --entrypoint-num-cpus=1 "
          "--entrypoint-num-gpus=1 --entrypoint-memory=4 --entrypoint-resources='{"
          '"Custom": 1}\' -- echo hello',
      )
      assert "hello" in stdout
  
imports: from contextlib import contextmanager
  import ray
  import json
  import os
  import logging
  import sys
  import subprocess
  from typing import Optional, Tuple
  import pytest
label_desc: Use image node_id 7 for calling a global function with example usage: test_resources(shutdown_only) without return types