code: def check_agent_register(raylet_proc, agent_pid):
      # Check if agent register is OK.
      for x in range(5):
          logger.info("Check agent is alive.")
          agent_proc = search_agent(raylet_proc.children())
          assert agent_proc.pid == agent_pid
          time.sleep(1)
  
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 3 for calling a global function with example usage: check_agent_register(raylet_proc, agent_pid) without return types