code: def post_trial_profiler_metrics_batches(
      master_url: str,
      batches: List[TrialProfilerMetricsBatch],
  ) -> None:
      """
      Post the given metrics to the master to be persisted. Labels
      must contain only a subset of the keys: trial_id,  name,
      gpu_uuid, agent_id and metric_type, where metric_type is one
      of PROFILER_METRIC_TYPE_SYSTEM or PROFILER_METRIC_TYPE_TIMING.
      """
      backoff_interval = 1
      max_tries = 2
      tries = 0
  
      while tries < max_tries:
          try:
              api.post(
                  master_url,
                  "/api/v1/trials/profiler/metrics",
                  json={"batches": [b.__dict__ for b in batches]},
              )
              return
          except exceptions.RequestException as e:
              if (
                  e.response is not None
                  and e.response.status_code < 500
              ):
                  raise e
  
              tries += 1
              if tries == max_tries:
                  raise e
              time.sleep(backoff_interval)
      return
  
file_path: determined/harness/determined/common/api/profiler.py
imports: import time
  from typing import Any, Dict, List, Optional
  from requests import exceptions
  from determined.common import api
label_desc: Use image node_id 1 for calling a global function with example usage: post_trial_profiler_metrics_batches(master_url, batches) without return types