code: def test_piecewise_linear_sampling(distr, params, serialize_fn):
      distr = distr(**params)
      distr = serialize_fn(distr)
      samples = distr.sample()
      assert samples.shape == (2,)
      num_samples = 100_000
      samples = distr.sample(num_samples)
      assert samples.shape == (num_samples, 2)
  
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 3 for calling a global function with example usage: test_piecewise_linear_sampling(distr, params, serialize_fn) without return types