code: def get_agent_data(master_url: str) -> List[Dict[str, Any]]:
      command = ["det", "-m", master_url, "agent", "list", "--json"]
      output = subprocess.check_output(command).decode()
      agent_data = cast(List[Dict[str, Any]], json.loads(output))
      return agent_data
  
imports: import json
  import os
  import subprocess
  import time
  from typing import Any, Dict, Iterator, List, Union, cast
  import pytest
  from tests import config
  from .abstract_cluster import Cluster
  from .test_users import logged_in_user
  from .utils import now_ts, set_master_port
label_desc: Use image node_id 1 for calling a global function with example usage: get_agent_data(master_url) and returns: agent_data