code: def __init__(
      self,
      values: List[Any],
      probas: List[float] = None,
      cache_size: int = 1000,
  ):
      self._values = values
      if probas is None:
          probas = [1.0 / len(values) for x in values]
      self._probas = probas
      self._cache_size = cache_size
      self._cache = []
  
file_path: imodels/imodels/experimental/bartpy/samplers/scalar.py
imports: from typing import Any, List
  import numpy
label_desc: Use image node_id 1 to create a new DiscreteSampler object  with example: obj = DiscreteSampler(values, probas, cache_size)