code: def search_agents(cluster):
      all_processes = cluster.head_node.all_processes
      raylet_proc_info = all_processes[
          ray_constants.PROCESS_TYPE_RAYLET
      ][0]
      raylet_proc = psutil.Process(raylet_proc_info.process.pid)
  
      def _search_agent(processes):
          for p in processes:
              try:
                  for c in p.cmdline():
                      if os.path.join("dashboard", "agent.py") in c:
                          return p
              except Exception:
                  pass
  
      agent_proc = _search_agent(raylet_proc.children())
      return agent_proc
  
imports: import os
  import re
  import subprocess
  import sys
  import time
  import psutil
  import pytest
  import requests
  import ray
  from ray._private import ray_constants
  from ray._private.test_utils import run_string_as_driver, wait_for_condition
label_desc: Use image node_id 1 for calling a global function with example usage: search_agents(cluster) and returns: agent_proc, p