code: def test_ray_address_environment_variable(ray_start_cluster):
      address = ray_start_cluster.address
      # In this test we use zero CPUs to distinguish between starting a local
      # ray cluster and connecting to an existing one.
  
      # Make sure we connect to an existing cluster if
      # RAY_ADDRESS is set to the cluster address.
      os.environ["RAY_ADDRESS"] = address
      ray.init()
      assert "CPU" not in ray._private.state.cluster_resources()
      ray.shutdown()
      del os.environ["RAY_ADDRESS"]
  
      # Make sure we connect to an existing cluster if
      # RAY_ADDRESS is set to "auto".
      os.environ["RAY_ADDRESS"] = "auto"
      ray.init()
      assert "CPU" not in ray._private.state.cluster_resources()
      ray.shutdown()
      del os.environ["RAY_ADDRESS"]
  
      # Prefer `address` parameter to the `RAY_ADDRESS` environment variable,
      # when `address` is not `auto`.
      os.environ["RAY_ADDRESS"] = "test"
      ray.init(address=address)
      assert "CPU" not in ray._private.state.cluster_resources()
      ray.shutdown()
      del os.environ["RAY_ADDRESS"]
  
      # Make sure we connect to the existing cluster with on args and RAY_ADDRESS
      # is not set.
      ray.init()
      assert "CPU" not in ray._private.state.cluster_resources()
      ray.shutdown()
  
      # Make sure we start a new cluster if "local" is explicitly passed.
      # is not set.
      ray.init(address="local")
      assert "CPU" in ray._private.state.cluster_resources()
      ray.shutdown()
  
imports: import glob
  import logging
  import multiprocessing
  import os
  import sys
  import tempfile
  import time
  from unittest import mock
  import numpy
  import psutil
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray._private.ray_constants
  import ray._private.utils
  import ray.cluster_utils
  import ray.util.accelerators
  from ray._private.test_utils import wait_for_condition
  from ray.dashboard import k8s_utils
  from ray.runtime_env import RuntimeEnv
label_desc: Use image node_id 4 for calling a global function with example usage: test_ray_address_environment_variable(ray_start_cluster) without return types