code: 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
  
imports: import asyncio
  import collections
  import copy
  import ipaddress
  import json
  import logging
  import os
  import subprocess
  import sys
  import time
  import warnings
  import pytest
  import requests
  import socket
  import ray
  import ray.dashboard.consts
  import ray.dashboard.modules
  import ray.dashboard.utils
  from click.testing import CliRunner
  from requests.exceptions import ConnectionError, HTTPError
  from ray._private import ray_constants
  from ray._private.ray_constants import DEBUG_AUTOSCALING_ERROR, DEBUG_AUTOSCALING_STATUS_LEGACY
  from ray._private.utils import get_or_create_event_loop
  from ray._private.test_utils import format_web_url, get_error_message, init_error_pubsub, run_string_as_driver, wait_for_condition, wait_until_server_available, wait_until_succeeded_without_exception
  import ray.scripts.scripts
  from ray.dashboard import dashboard
  from ray.dashboard.head import DashboardHead
  from ray.util.state import StateApiClient
  from ray.util.state.common import ListApiOptions, StateResource
  from ray.util.state.exception import ServerUnavailable
  from ray.experimental.internal_kv import _initialize_internal_kv
  from unittest.mock import MagicMock
  from ray.dashboard.utils import DashboardHeadModule
  import psutil
label_desc: Use image node_id 4 for calling a global function with example usage: search_agent(processes) and returns: p