code: def test_discretenb_provide_prior(DiscreteNaiveBayes):
      # Test whether discrete NB classes use provided prior
  
      clf = DiscreteNaiveBayes(class_prior=[0.5, 0.5])
      clf.fit([[0], [0], [1]], [0, 0, 1])
      prior = np.exp(clf.class_log_prior_)
      assert_array_almost_equal(prior, np.array([0.5, 0.5]))
  
      # Inconsistent number of classes with prior
      msg = "Number of priors must match number of classes"
      with pytest.raises(ValueError, match=msg):
          clf.fit([[0], [1], [2]], [0, 1, 2])
  
      msg = "is not the same as on last call to partial_fit"
      with pytest.raises(ValueError, match=msg):
          clf.partial_fit([[0], [1]], [0, 1], classes=[0, 1, 1])
  
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 20 for calling a global function with example usage: test_discretenb_provide_prior(DiscreteNaiveBayes) without return types