code: def test_Percentiles(metrics):
      buckets = 100
      _percentiles = [
          Percentile(metrics.metric_name("test.p25", "grp1"), 25),
          Percentile(metrics.metric_name("test.p50", "grp1"), 50),
          Percentile(metrics.metric_name("test.p75", "grp1"), 75),
      ]
      percs = Percentiles(
          4 * buckets,
          BucketSizing.CONSTANT,
          100.0,
          0.0,
          percentiles=_percentiles,
      )
      config = MetricConfig(event_window=50, samples=2)
      sensor = metrics.sensor("test", config)
      sensor.add_compound(percs)
      p25 = metrics.metrics.get(metrics.metric_name("test.p25", "grp1"))
      p50 = metrics.metrics.get(metrics.metric_name("test.p50", "grp1"))
      p75 = metrics.metrics.get(metrics.metric_name("test.p75", "grp1"))
  
      # record two windows worth of sequential values
      for i in range(buckets):
          sensor.record(i)
  
      assert abs(p25.value() - 25) < 1.0
      assert abs(p50.value() - 50) < 1.0
      assert abs(p75.value() - 75) < 1.0
  
      for i in range(buckets):
          sensor.record(0.0)
  
      assert p25.value() < 1.0
      assert p50.value() < 1.0
      assert p75.value() < 1.0
  
imports: import sys
  import time
  import pytest
  from kafka.errors import QuotaViolationError
  from kafka.metrics import DictReporter, MetricConfig, MetricName, Metrics, Quota
  from kafka.metrics.measurable import AbstractMeasurable
  from kafka.metrics.stats import Avg, Count, Max, Min, Percentile, Percentiles, Rate, Total
  from kafka.metrics.stats.percentiles import BucketSizing
  from kafka.metrics.stats.rate import TimeUnit
label_desc: Use image node_id 18 for calling a global function with example usage: test_Percentiles(metrics) without return types