code: def ray_with_memory_monitor(shutdown_only):
      with ray.init(
          num_cpus=1,
          object_store_memory=100 * 1024 * 1024,
          _system_config={
              "memory_usage_threshold": memory_usage_threshold,
              "memory_monitor_refresh_ms": memory_monitor_refresh_ms,
              "metrics_report_interval_ms": 100,
              "task_failure_entry_ttl_ms": 2 * 60 * 1000,
              "task_oom_retries": task_oom_retries,
              "min_memory_free_bytes": -1,
              "task_oom_retry_delay_base_ms": 0,
          },
      ) as addr:
          yield addr
  
imports: from math import ceil
  import sys
  import time
  import pytest
  import ray
  from ray._private import ray_constants
  import ray._private.gcs_utils
  from ray._private.test_utils import wait_for_condition, raw_metrics
  import numpy
  from ray._private.utils import get_system_memory
  from ray._private.utils import get_used_memory
  from ray._private.state_api_test_utils import verify_failed_task
  from ray.util.state.state_manager import StateDataSourceClient
label_desc: Use image node_id 2 for calling a global function with example usage: ray_with_memory_monitor(shutdown_only) without return types