code: def test_most_frequent_and_prior_strategy():
      X = [[0], [0], [0], [0]]  # ignored
      y = [1, 2, 1, 1]
  
      for strategy in ("most_frequent", "prior"):
          clf = DummyClassifier(strategy=strategy, random_state=0)
          clf.fit(X, y)
          assert_array_equal(clf.predict(X), np.ones(len(X)))
          _check_predict_proba(clf, X, y)
  
          if strategy == "prior":
              assert_array_almost_equal(
                  clf.predict_proba([X[0]]),
                  clf.class_prior_.reshape((1, -1)),
              )
          else:
              assert_array_almost_equal(
                  clf.predict_proba([X[0]]),
                  clf.class_prior_.reshape((1, -1)) > 0.5,
              )
  
imports: import numpy
  import pytest
  import scipy.sparse
  from sklearn.base import clone
  from sklearn.dummy import DummyClassifier, DummyRegressor
  from sklearn.exceptions import NotFittedError
  from sklearn.utils._testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal, ignore_warnings
  from sklearn.utils.fixes import CSC_CONTAINERS
  from sklearn.utils.stats import _weighted_percentile
label_desc: Use image node_id 5 for calling a global function with example usage: test_most_frequent_and_prior_strategy() without return types