code: def test_mnb_prior_unobserved_targets():
      # test smoothing of prior for yet unobserved targets
  
      # Create toy training data
      X = np.array([[0, 1], [1, 0]])
      y = np.array([0, 1])
  
      clf = MultinomialNB()
  
      with warnings.catch_warnings():
          warnings.simplefilter("error", RuntimeWarning)
  
          clf.partial_fit(X, y, classes=[0, 1, 2])
  
      assert clf.predict([[0, 1]]) == 0
      assert clf.predict([[1, 0]]) == 1
      assert clf.predict([[1, 1]]) == 0
  
      # add a training example with previously unobserved class
      with warnings.catch_warnings():
          warnings.simplefilter("error", RuntimeWarning)
  
          clf.partial_fit([[1, 1]], [2])
  
      assert clf.predict([[0, 1]]) == 0
      assert clf.predict([[1, 0]]) == 1
      assert clf.predict([[1, 1]]) == 2
  
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 25 for calling a global function with example usage: test_mnb_prior_unobserved_targets() without return types