code: def check_svm_model_equal(
      queue, svm, X_train, y_train, X_test, decimal=6
  ):
      sparse_svm = clone_estimator(svm)
      dense_svm = clone_estimator(svm)
      dense_svm.fit(X_train.toarray(), y_train, queue=queue)
      if sp.issparse(X_test):
          X_test_dense = X_test.toarray()
      else:
          X_test_dense = X_test
      sparse_svm.fit(X_train, y_train, queue=queue)
      assert sp.issparse(sparse_svm.support_vectors_)
      assert sp.issparse(sparse_svm.dual_coef_)
      assert_array_almost_equal(
          dense_svm.support_vectors_,
          sparse_svm.support_vectors_.toarray(),
          decimal,
      )
      assert_array_almost_equal(
          dense_svm.dual_coef_, sparse_svm.dual_coef_.toarray(), decimal
      )
      assert_array_almost_equal(dense_svm.support_, sparse_svm.support_)
      assert_array_almost_equal(
          dense_svm.predict(X_test_dense, queue=queue),
          sparse_svm.predict(X_test, queue=queue),
      )
  
      if is_classifier(svm):
          assert_array_almost_equal(
              dense_svm.decision_function(X_test_dense, queue=queue),
              sparse_svm.decision_function(X_test, queue=queue),
              decimal,
          )
  
imports: import numpy
  import pytest
  import sklearn.utils.estimator_checks
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from scipy import sparse
  from sklearn import datasets, metrics
  from sklearn.base import clone
  from sklearn.datasets import make_blobs, make_classification
  from sklearn.metrics.pairwise import rbf_kernel
  from sklearn.model_selection import train_test_split
  from sklearn.utils.estimator_checks import check_estimator
  from onedal.svm import SVC, SVR
  from onedal.tests.utils._device_selection import get_queues, pass_if_not_implemented_for_gpu
label_desc: Use image node_id 2 for calling a global function with example usage: check_svm_model_equal(queue, svm, X_train, y_train, X_test, decimal) without return types