code: def test_register_naive_bayes_serialization():
      """
      Assuming here that the Dask serializers are well-tested.
      This test-case is only validating that register_serialization
      actually provides the expected serializers on the expected
      objects.
      """
  
      mnb = MultinomialNB()
  
      X = cupyx.scipy.sparse.random(1, 5)
      y = cp.array([0])
  
      mnb.fit(X, y)
  
      # Unfortunately, Dask has no `unregister` function and Pytest
      # shares the same process so cannot test the base-state here.
  
      stype, sbytes = serialize(mnb, serializers=["cuda"])
  
      assert stype["serializer"] == "cuda"
  
      stype, sbytes = serialize(mnb, serializers=["dask"])
  
      assert stype["serializer"] == "dask"
  
file_path: cuml/python/cuml/tests/dask/test_dask_serialization.py
imports: from distributed.protocol.serialize import serialize
  from cuml.naive_bayes.naive_bayes import MultinomialNB
  from cuml.internals.array_sparse import SparseCumlArray
  from cuml.dask.linear_model import LinearRegression
  from cuml.internals.safe_imports import gpu_only_import
  from dask import array
  from sklearn.datasets import make_regression
  import numpy
  import pickle
label_desc: Use image node_id 1 for calling a global function with example usage: test_register_naive_bayes_serialization() without return types