code: def test_categoricalnb_min_categories_errors(
      min_categories, error_msg
  ):
      X = np.array([[0, 0], [0, 1], [0, 0], [1, 1]])
      y = np.array([1, 1, 2, 2])
  
      clf = CategoricalNB(
          alpha=1, fit_prior=False, min_categories=min_categories
      )
      with pytest.raises(ValueError, match=error_msg):
          clf.fit(X, y)
  
imports: import re
  import warnings
  import numpy
  import pytest
  from scipy.special import logsumexp
  from sklearn.datasets import load_digits, load_iris
  from sklearn.model_selection import cross_val_score, train_test_split
  from sklearn.naive_bayes import BernoulliNB, CategoricalNB, ComplementNB, GaussianNB, MultinomialNB
  from sklearn.utils._testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 31 for calling a global function with example usage: test_categoricalnb_min_categories_errors(min_categories, error_msg) without return types