code: def test_hdbscan_cluster_patterns(
      dataset,
      nrows,
      connectivity,
      cluster_selection_epsilon,
      cluster_selection_method,
      min_cluster_size,
      allow_single_cluster,
      max_cluster_size,
      min_samples,
  ):
      # This also tests duplicate data points
      X, y = get_pattern(dataset, nrows)[0]
  
      cuml_agg = HDBSCAN(
          verbose=logger.level_info,
          allow_single_cluster=allow_single_cluster,
          min_samples=min_samples,
          max_cluster_size=max_cluster_size,
          min_cluster_size=min_cluster_size,
          cluster_selection_epsilon=cluster_selection_epsilon,
          cluster_selection_method=cluster_selection_method,
      )
  
      cuml_agg.fit(X)
  
      sk_agg = hdbscan.HDBSCAN(
          allow_single_cluster=allow_single_cluster,
          approx_min_span_tree=False,
          gen_min_span_tree=True,
          min_samples=min_samples,
          min_cluster_size=min_cluster_size,
          cluster_selection_epsilon=cluster_selection_epsilon,
          cluster_selection_method=cluster_selection_method,
          algorithm="generic",
      )
  
      sk_agg.fit(cp.asnumpy(X))
  
      assert_condensed_trees(sk_agg, min_cluster_size)
      assert_cluster_counts(sk_agg, cuml_agg)
  
      assert len(np.unique(sk_agg.labels_)) == len(
          cp.unique(cuml_agg.labels_)
      )
      assert (
          adjusted_rand_score(cuml_agg.labels_, sk_agg.labels_) > 0.95
      )
  
      assert np.allclose(
          np.sort(sk_agg.cluster_persistence_),
          np.sort(cuml_agg.cluster_persistence_),
          rtol=0.1,
          atol=0.1,
      )
  
imports: from cuml.internals.safe_imports import gpu_only_import
  from sklearn.model_selection import train_test_split
  from sklearn import datasets
  from hdbscan.plots import CondensedTree
  import hdbscan
  from cuml.internals import logger
  import pytest
  from cuml.cluster.hdbscan import HDBSCAN, condense_hierarchy
  from cuml.cluster.hdbscan.prediction import all_points_membership_vectors, approximate_predict, membership_vector
  from sklearn.datasets import make_blobs
  from cuml.metrics import adjusted_rand_score
  from cuml.testing.utils import get_pattern, array_equal
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 9 for calling a global function with example usage: test_hdbscan_cluster_patterns(dataset, nrows, connectivity, cluster_selection_epsilon, cluster_selection_method, min_cluster_size, allow_single_cluster, max_cluster_size, min_samples) without return types