code: def _test_initialization(d, x, name, inertia, frozen, dtype):
      assert d.inertia == inertia
      assert d.frozen == frozen
      param = getattr(d, name)
  
      if x is not None:
          assert param.shape == (len(x), len(x[0]))
          assert param.dtype == dtype
          assert_array_almost_equal(param, x)
      else:
          assert param == x
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.distributions import Categorical
  from ._utils import _test_initialization_raises_one_parameter
  from ._utils import _test_predictions
  from ._utils import _test_raises
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 6 for calling a global function with example usage: _test_initialization(d, x, name, inertia, frozen, dtype) without return types