code: def test_dirichlet_multinomial(hybridize: bool) -> None:
      num_samples = 2000
      dim = 3
      n_trials = 500
  
      alpha = np.array([1.0, 2.0, 3.0])
  
      distr = DirichletMultinomial(
          dim=3, n_trials=n_trials, alpha=mx.nd.array(alpha)
      )
      cov = distr.variance.asnumpy()
  
      samples = distr.sample(num_samples)
  
      alpha_hat = maximum_likelihood_estimate_sgd(
          DirichletMultinomialOutput(dim=dim, n_trials=n_trials),
          samples,
          init_biases=None,
          hybridize=hybridize,
          learning_rate=PositiveFloat(0.05),
          num_epochs=PositiveInt(10),
      )
  
      distr = DirichletMultinomial(
          dim=3, n_trials=n_trials, alpha=mx.nd.array(alpha_hat)
      )
  
      cov_hat = distr.variance.asnumpy()
  
      assert np.allclose(
          alpha_hat, alpha, atol=0.1, rtol=0.1
      ), f"alpha did not match: alpha = {alpha}, alpha_hat = {alpha_hat}"
      assert np.allclose(
          cov_hat, cov, atol=0.1, rtol=0.1
      ), f"Covariance did not match: cov = {cov}, cov_hat = {cov_hat}"
  
imports: from functools import reduce
  from typing import List, Tuple
  import mxnet
  import numpy
  import pytest
  from gluonts.mx.model.tpp.distribution import Loglogistic, LoglogisticOutput, Weibull, WeibullOutput
  from gluonts.mx.distribution import Beta, BetaOutput, Binned, BinnedOutput, Categorical, CategoricalOutput, Dirichlet, DirichletMultinomial, DirichletMultinomialOutput, DirichletOutput, DistributionOutput, EmpiricalDistributionOutput, Gamma, GammaOutput, Gaussian, GaussianOutput, GenPareto, GenParetoOutput, Laplace, LaplaceOutput, LogitNormal, LogitNormalOutput, LowrankMultivariateGaussian, LowrankMultivariateGaussianOutput, MultivariateGaussian, MultivariateGaussianOutput, NegativeBinomial, NegativeBinomialOutput, OneInflatedBeta, OneInflatedBetaOutput, PiecewiseLinear, PiecewiseLinearOutput, Poisson, PoissonOutput, StudentT, StudentTOutput, ZeroAndOneInflatedBeta, ZeroAndOneInflatedBetaOutput, ZeroInflatedBeta, ZeroInflatedBetaOutput, ZeroInflatedNegativeBinomialOutput, ZeroInflatedPoissonOutput
  from gluonts.mx.distribution.box_cox_transform import InverseBoxCoxTransform, InverseBoxCoxTransformOutput
  from gluonts.mx.distribution.transformed_distribution import TransformedDistribution
  from gluonts.mx.distribution.transformed_distribution_output import TransformedDistributionOutput
  from gluonts.pydantic import PositiveFloat, PositiveInt
label_desc: Use image node_id 10 for calling a global function with example usage: test_dirichlet_multinomial(hybridize) without return types