code: def test_svm_single_node(shutdown_only):
      digits = load_digits()
      param_space = {
          "C": np.logspace(-6, 6, 10),
          "gamma": np.logspace(-8, 8, 10),
          "tol": np.logspace(-4, -1, 3),
          "class_weight": [None, "balanced"],
      }
  
      class MockParallel(joblib.Parallel):
          def _terminate_backend(self):
              if self._backend is not None:
                  # test ObjectRef caching (PR #16879)
                  assert any(
                      o is digits.data
                      for o, ref in self._backend._pool._registry
                  )
                  self._backend.terminate()
  
      model = SVC(kernel="rbf")
      with mock.patch(
          "sklearn.model_selection._search.Parallel", MockParallel
      ):
          search = RandomizedSearchCV(
              model, param_space, cv=3, n_iter=2, verbose=10
          )
          register_ray()
          with joblib.parallel_backend("ray"):
              search.fit(digits.data, digits.target)
      assert ray.is_initialized()
  
imports: import joblib
  import sys
  import time
  import os
  import pytest
  from unittest import mock
  import pickle
  import numpy
  from sklearn.datasets import load_digits, load_iris
  from sklearn.model_selection import RandomizedSearchCV
  from sklearn.ensemble import ExtraTreesClassifier
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.kernel_approximation import Nystroem
  from sklearn.kernel_approximation import RBFSampler
  from sklearn.pipeline import make_pipeline
  from sklearn.svm import LinearSVC, SVC
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.linear_model import LogisticRegression
  from sklearn.neural_network import MLPClassifier
  from sklearn.model_selection import cross_val_score
  from ray.util.joblib import register_ray
  import ray
label_desc: Use image node_id 3 for calling a global function with example usage: test_svm_single_node(shutdown_only) without return types