code: def test_inflated_beta_sampling(
      alpha: float,
      beta: float,
      zero_probability: float,
      one_probability: float,
  ):
      distr = ZeroAndOneInflatedBeta(
          alpha=mx.nd.array([alpha]),
          beta=mx.nd.array([beta]),
          zero_probability=mx.nd.array([zero_probability]),
          one_probability=mx.nd.array([one_probability]),
      )
      samples = distr.sample()
      assert samples.shape == (1,)
      num_samples = 100_000
      samples = distr.sample(num_samples)
      assert samples.shape == (num_samples, 1)
  
      category = np.random.choice(
          [0, 1, 2],
          p=[
              zero_probability,
              one_probability,
              1 - zero_probability - one_probability,
          ],
          size=num_samples,
      )
      samples_numpy = np.random.beta(a=alpha, b=beta, size=num_samples)
      samples_numpy[category == 0] = 0
      samples_numpy[category == 1] = 1
      assert np.allclose(
          np.histogram(samples_numpy)[0],
          np.histogram(samples.asnumpy())[0],
          rtol=0.08,
      )
  
file_path: gluonts/test/mx/distribution/test_distribution_sampling.py
imports: import mxnet
  import numpy
  import pytest
  from flaky import flaky
  from gluonts.core.serde import dump_json, load_json
  from gluonts.mx.model.tpp.distribution import Loglogistic, Weibull
  from gluonts.mx.distribution import Beta, Binned, Categorical, Dirichlet, DirichletMultinomial, Gamma, Gaussian, GenPareto, Laplace, MultivariateGaussian, NegativeBinomial, PiecewiseLinear, Poisson, StudentT, Uniform, ZeroAndOneInflatedBeta
  from gluonts.testutil import empirical_cdf
label_desc: Use image node_id 4 for calling a global function with example usage: test_inflated_beta_sampling(alpha, beta, zero_probability, one_probability) without return types