code: def assert_distribution_almost_equal(
      d1: _MixtureOfProductDistribution,
      d2: _MixtureOfProductDistribution,
  ) -> None:
      np.testing.assert_almost_equal(d1.weights, d2.weights)
      for d1_, d2_ in zip(d1.distributions, d2.distributions):
          assert type(d1_) is type(d2_)
          for field1, field2 in zip(d1_, d2_):
              np.testing.assert_almost_equal(
                  np.array(field1), np.array(field2)
              )
  
imports: from typing import Callable
  from typing import Dict
  from typing import List
  import numpy
  import pytest
  from optuna import distributions
  from optuna.distributions import CategoricalChoiceType
  from optuna.samplers._tpe.parzen_estimator import _ParzenEstimator
  from optuna.samplers._tpe.parzen_estimator import _ParzenEstimatorParameters
  from optuna.samplers._tpe.probability_distributions import _BatchedCategoricalDistributions
  from optuna.samplers._tpe.probability_distributions import _BatchedDiscreteTruncNormDistributions
  from optuna.samplers._tpe.probability_distributions import _BatchedTruncNormDistributions
  from optuna.samplers._tpe.probability_distributions import _MixtureOfProductDistribution
  from optuna.samplers._tpe.sampler import default_weights
label_desc: Use image node_id 1 for calling a global function with example usage: assert_distribution_almost_equal(d1, d2) without return types