code: def test_NB_partial_fit_no_first_classes(
      NaiveBayes, global_random_seed
  ):
      # classes is required for first call to partial fit
      X2, y2 = get_random_integer_x_three_classes_y(global_random_seed)
  
      with pytest.raises(
          ValueError,
          match="classes must be passed on the first call to partial_fit.",
      ):
          NaiveBayes().partial_fit(X2, y2)
  
      # check consistency of consecutive classes values
      clf = NaiveBayes()
      clf.partial_fit(X2, y2, classes=np.unique(y2))
      with pytest.raises(
          ValueError,
          match="is not the same as on last call to partial_fit",
      ):
          clf.partial_fit(X2, y2, classes=np.arange(42))
  
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 17 for calling a global function with example usage: test_NB_partial_fit_no_first_classes(NaiveBayes, global_random_seed) without return types