code: def test_ray_debugger_commands(shutdown_only):
      ray.init(num_cpus=2)
  
      @ray.remote
      def f():
          """We support unicode too: 🐛"""
          ray.util.pdb.set_trace()
  
      result1 = f.remote()
      result2 = f.remote()
  
      wait_for_condition(
          lambda: len(
              ray.experimental.internal_kv._internal_kv_list(
                  "RAY_PDB_", namespace=ray_constants.KV_NAMESPACE_PDB
              )
          )
          > 0
      )
  
      # Make sure that calling "continue" in the debugger
      # gives back control to the debugger loop:
      p = pexpect.spawn("ray debug")
      p.expect("Enter breakpoint index or press enter to refresh: ")
      p.sendline("0")
      p.expect("-> ray.util.pdb.set_trace()")
      p.sendline("ll")
      # Cannot use the 🐛 symbol here because pexpect doesn't support
      # unicode, but this test also does nicely:
      p.expect("unicode")
      p.sendline("c")
      p.expect("Enter breakpoint index or press enter to refresh: ")
      p.sendline("0")
      p.expect("-> ray.util.pdb.set_trace()")
      p.sendline("c")
  
      ray.get([result1, result2])
  
imports: import json
  import os
  import platform
  import subprocess
  import sys
  from telnetlib import Telnet
  import unittest
  import pexpect
  import pytest
  import ray
  from ray._private import ray_constants, services
  from ray._private.test_utils import run_string_as_driver, wait_for_condition
  from ray.cluster_utils import Cluster, cluster_not_supported
label_desc: Use image node_id 2 for calling a global function with example usage: test_ray_debugger_commands(shutdown_only) without return types