code: def calc_p(latencies, percent):
      if len(latencies) == 0:
          return 0
  
      return round(
          sorted(latencies)[int(len(latencies) / 100 * percent)] * 1000,
          3,
      )
  
imports: import asyncio
  import time
  import urllib
  from typing import Dict, Optional, List
  from pprint import pprint
  import requests
  import ray
  import logging
  from collections import defaultdict
  from ray.util.state import list_nodes
  from ray._private.test_utils import fetch_prometheus_metrics
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy
  from pydantic import BaseModel
  from ray.dashboard.consts import DASHBOARD_METRIC_PORT
  from ray.dashboard.utils import get_address_for_submission_client
label_desc: Use image node_id 1 for calling a global function with example usage: calc_p(latencies, percent) and returns: round, int