code: def search_agent(processes):
      for p in processes:
          try:
              for c in p.cmdline():
                  if (
                      os.path.join("runtime_env", "agent", "main.py")
                      in c
                  ):
                      return p
          except Exception:
              pass
  
file_path: ray/python/ray/tests/test_runtime_env_agent.py
imports: import sys
  import pytest
  import logging
  import os
  import time
  from typing import List, Tuple
  import ray
  from ray._private.runtime_env.agent.runtime_env_agent import UriType, ReferenceTable
  from ray._private import ray_constants
  from ray._private.test_utils import get_error_message, init_error_pubsub, wait_for_condition
  from ray.runtime_env import RuntimeEnv
  import psutil
label_desc: Use image node_id 2 for calling a global function with example usage: search_agent(processes) and returns: p