code: def test_hdbscan_methods(train_device, infer_device):
      if train_device == "gpu" and infer_device == "cpu":
          pytest.skip("Can't transfer attributes to cpu for now")
  
      ref_model = refHDBSCAN(
          prediction_data=True,
          approx_min_span_tree=False,
          max_cluster_size=0,
          min_cluster_size=30,
      )
      ref_trained_labels = ref_model.fit_predict(X_train_blob)
  
      from hdbscan.prediction import (
          all_points_membership_vectors as cpu_all_points_membership_vectors,
          approximate_predict as cpu_approximate_predict,
      )
  
      ref_membership = cpu_all_points_membership_vectors(ref_model)
      ref_labels, ref_probs = cpu_approximate_predict(
          ref_model, X_test_blob
      )
  
      model = HDBSCAN(
          prediction_data=True,
          approx_min_span_tree=False,
          max_cluster_size=0,
          min_cluster_size=30,
      )
      with using_device_type(train_device):
          trained_labels = model.fit_predict(X_train_blob)
      with using_device_type(infer_device):
          from cuml.cluster.hdbscan.prediction import (
              all_points_membership_vectors,
              approximate_predict,
          )
  
          membership = all_points_membership_vectors(model)
          labels, probs = approximate_predict(model, X_test_blob)
  
      assert (
          adjusted_rand_score(trained_labels, ref_trained_labels)
          >= 0.95
      )
      assert_membership_vectors(membership, ref_membership)
      assert adjusted_rand_score(labels, ref_labels) >= 0.98
      assert array_equal(
          probs, ref_probs, unit_tol=0.001, total_tol=0.006
      )
  
imports: import platform
  from cuml.testing.test_preproc_utils import to_output_type
  from cuml.testing.utils import array_equal
  from cuml.cluster.hdbscan import HDBSCAN
  from cuml.neighbors import NearestNeighbors
  from cuml.metrics import trustworthiness
  from cuml.metrics import adjusted_rand_score
  from cuml.manifold import UMAP
  from cuml.linear_model import ElasticNet, Lasso, LinearRegression, LogisticRegression, Ridge
  from cuml.internals.memory_utils import using_memory_type
  from cuml.internals.mem_type import MemoryType
  from cuml.decomposition import PCA, TruncatedSVD
  from cuml.common.device_selection import DeviceType, using_device_type
  from hdbscan import HDBSCAN
  from sklearn.neighbors import NearestNeighbors
  from sklearn.linear_model import Ridge
  from sklearn.linear_model import ElasticNet
  from sklearn.linear_model import Lasso
  from sklearn.linear_model import LogisticRegression
  from sklearn.linear_model import LinearRegression
  from sklearn.decomposition import PCA
  from sklearn.decomposition import TruncatedSVD
  from sklearn.datasets import make_regression, make_blobs
  from pytest_cases import fixture_union, fixture_plus
  from importlib import import_module
  import inspect
  import pickle
  from cuml.internals.safe_imports import gpu_only_import
  import itertools
  import pytest
  import cuml
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 37 for calling a global function with example usage: test_hdbscan_methods(train_device, infer_device) without return types