class_docstr: A compound stat that reports one or more percentiles
class_docstr_tok: ["A","compound","stat","that","reports","one","or","more","percentiles"]
code: def __init__(
      self,
      size_in_bytes,
      bucketing,
      max_val,
      min_val=0.0,
      percentiles=None,
  ):
      super(Percentiles, self).__init__(0.0)
      self._percentiles = percentiles or []
      self._buckets = int(size_in_bytes / 4)
      if bucketing == BucketSizing.CONSTANT:
          self._bin_scheme = Histogram.ConstantBinScheme(
              self._buckets, min_val, max_val
          )
      elif bucketing == BucketSizing.LINEAR:
          if min_val != 0.0:
              raise ValueError(
                  "Linear bucket sizing requires min_val" " to be 0.0."
              )
          self.bin_scheme = Histogram.LinearBinScheme(
              self._buckets, max_val
          )
      else:
          ValueError("Unknown bucket type: %s" % (bucketing,))
  
file_path: kafka-python/kafka/metrics/stats/percentiles.py
imports: from __future__ import absolute_import
  from kafka.metrics import AnonMeasurable, NamedMeasurable
  from kafka.metrics.compound_stat import AbstractCompoundStat
  from kafka.metrics.stats import Histogram
  from kafka.metrics.stats.sampled_stat import AbstractSampledStat
label_desc: Use image node_id 1 to create a new Percentiles object from inherited base classes: AbstractSampledStat, AbstractCompoundStat with example: obj = Percentiles(size_in_bytes, bucketing, max_val, min_val, percentiles)