code: def test_multinomial(x_dtype, y_dtype, nlp_20news):
      X, y = nlp_20news
  
      cu_X = sparse_scipy_to_cp(X, x_dtype).astype(x_dtype)
      cu_y = y.astype(y_dtype)
  
      cu_X = cu_X.tocsr()
  
      y = y.get()
  
      cuml_model = MultinomialNB()
      sk_model = skNB()
  
      cuml_model.fit(cu_X, cu_y)
      sk_model.fit(X, y)
  
      cuml_log_proba = cuml_model.predict_log_proba(cu_X).get()
      sk_log_proba = sk_model.predict_log_proba(X)
      cuml_proba = cuml_model.predict_proba(cu_X).get()
      sk_proba = sk_model.predict_proba(X)
      cuml_score = cuml_model.score(cu_X, cu_y)
      sk_score = sk_model.score(X, y)
  
      y_hat = cuml_model.predict(cu_X)
      y_hat = cp.asnumpy(y_hat)
      cu_y = cp.asnumpy(cu_y)
  
      THRES = 1e-4
      assert_allclose(
          cuml_log_proba, sk_log_proba, atol=1e-2, rtol=1e-2
      )
      assert_allclose(cuml_proba, sk_proba, atol=1e-6, rtol=1e-2)
      assert sk_score - THRES <= cuml_score <= sk_score + THRES
      assert accuracy_score(y, y_hat) >= 0.924
  
imports: from cuml.internals.safe_imports import cpu_only_import
  import math
  from sklearn.naive_bayes import GaussianNB
  from sklearn.naive_bayes import ComplementNB
  from sklearn.naive_bayes import CategoricalNB
  from sklearn.naive_bayes import BernoulliNB
  from sklearn.naive_bayes import MultinomialNB
  from numpy.testing import assert_array_almost_equal, assert_raises
  from numpy.testing import assert_allclose, assert_array_equal
  from cuml.datasets import make_classification
  from cuml.internals.input_utils import sparse_scipy_to_cp
  from cuml.naive_bayes import GaussianNB
  from cuml.naive_bayes import ComplementNB
  from cuml.naive_bayes import CategoricalNB
  from cuml.naive_bayes import BernoulliNB
  from cuml.naive_bayes import MultinomialNB
  from sklearn.metrics import accuracy_score
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 4 for calling a global function with example usage: test_multinomial(x_dtype, y_dtype, nlp_20news) without return types