code: def test_fit_chain(X):
      d = ConditionalCategorical().fit(X[:4])
      _test_efd_from_summaries(
          d,
          "probs",
          "_log_probs",
          [
              [[0.50, 0.50], [0.75, 0.25]],
              [[0.50, 0.50], [0.50, 0.50], [0.50, 0.50]],
              [[1.00, 0.00], [0.00, 1.00]],
          ],
      )
  
      d.fit(X[4:])
      _test_efd_from_summaries(
          d,
          "probs",
          "_log_probs",
          [
              [[1.00, 0.00], [0.50, 0.50]],
              [[0.50, 0.50], [0.6666667, 0.33333334], [0.50, 0.50]],
              [[1.00, 0.00], [0.00, 1.00]],
          ],
      )
  
      d = ConditionalCategorical().fit(X)
      _test_efd_from_summaries(
          d,
          "probs",
          "_log_probs",
          [
              [[1.0, 0.0], [0.6666667, 0.33333334]],
              [[0.50, 0.50], [0.6666667, 0.33333334], [0.50, 0.50]],
              [[1.00, 0.00], [0.00, 1.00]],
          ],
      )
  
imports: import numpy
  import torch
  import pytest
  from pomegranate.distributions import ConditionalCategorical
  from ._utils import _test_initialization_raises_one_parameter
  from ._utils import _test_initialization
  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 33 for calling a global function with example usage: test_fit_chain(X) without return types