code: def test_categorical_learn_structure_exact():
      numpy.random.seed(0)
      X = numpy.random.randint(3, size=(50, 7))
      w = numpy.abs(numpy.random.randn(50))
  
      structure1 = _categorical_exact(X)
      structure2 = _learn_structure(X, algorithm="exact")
      assert_tuple_equal(structure1, structure2)
  
      structure1 = _categorical_exact(X, max_parents=1)
      structure2 = _learn_structure(X, max_parents=1, algorithm="exact")
      assert_tuple_equal(structure1, structure2)
  
      structure1 = _categorical_exact(X, pseudocount=50)
      structure2 = _learn_structure(
          X, pseudocount=50, algorithm="exact"
      )
      assert_tuple_equal(structure1, structure2)
  
      structure1 = _categorical_exact(X, w)
      structure2 = _learn_structure(X, w, algorithm="exact")
      assert_tuple_equal(structure1, structure2)
  
imports: import numpy
  import torch
  import pytest
  from pomegranate.bayesian_network import BayesianNetwork
  from pomegranate.bayesian_network import _from_structure
  from pomegranate.bayesian_network import _learn_structure
  from pomegranate.bayesian_network import _categorical_exact
  from pomegranate.bayesian_network import _categorical_chow_liu
  from pomegranate.distributions import Categorical
  from pomegranate.distributions import ConditionalCategorical
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 16 for calling a global function with example usage: test_categorical_learn_structure_exact() without return types