code: def determine_if_memory_monitor_is_enabled_in_latest_session():
      """
      Grep session_latest raylet logs to see if the memory monitor is enabled.
      This is really only helpful when you're interested in session_latest, use with care.
      """
      import subprocess
  
      completed_proc = subprocess.run(
          [
              "grep",
              "-q",
              "MemoryMonitor initialized",
              "/tmp/ray/session_latest/logs/raylet.out",
          ],
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
      )
  
      assert completed_proc.returncode in [
          0,
          1,
      ], f"Unexpected returncode {completed_proc.returncode}"
      assert (
          not completed_proc.stdout
      ), f"Unexpected stdout {completed_proc.stdout}"
      assert (
          not completed_proc.stderr
      ), f"Unexpected stderr {completed_proc.stderr}"
  
      return completed_proc.returncode == 0
  
file_path: ray/release/air_tests/air_benchmarks/mlperf-train/metric_utils.py
imports: import threading
  import time
label_desc: Use image node_id 2 for calling a global function with example usage: determine_if_memory_monitor_is_enabled_in_latest_session() and returns: unknown