code: def test_hdbscan_allow_single_cluster_with_epsilon():
      np.random.seed(0)
      no_structure = np.random.rand(150, 2)
      # without epsilon we should see many noise points as children of root.
      labels = HDBSCAN(
          min_cluster_size=5,
          cluster_selection_epsilon=0.0,
          cluster_selection_method="eom",
          allow_single_cluster=True,
      ).fit_predict(no_structure)
      unique_labels, counts = np.unique(labels, return_counts=True)
      assert len(unique_labels) == 2
      assert counts[unique_labels == -1] == 46
  
      # for this random seed an epsilon of 0.2 will produce exactly 2 noise
      # points at that cut in single linkage.
      labels = HDBSCAN(
          min_cluster_size=5,
          cluster_selection_epsilon=0.2,
          cluster_selection_method="eom",
          allow_single_cluster=True,
      ).fit_predict(no_structure)
      unique_labels, counts = np.unique(labels, return_counts=True)
      assert len(unique_labels) == 2
      assert counts[unique_labels == -1] == 2
  
imports: import numpy
  from scipy.spatial import distance
  from scipy import sparse
  from scipy import stats
  from sklearn.utils.estimator_checks import check_estimator
  from sklearn.utils._testing import assert_array_equal, assert_array_almost_equal, assert_raises
  from hdbscan import HDBSCAN, hdbscan, validity_index, approximate_predict, approximate_predict_scores, membership_vector, all_points_membership_vectors
  from sklearn.datasets import make_blobs
  from sklearn.utils import shuffle
  from sklearn.preprocessing import StandardScaler
  from scipy.stats import mode
  from tempfile import mkdtemp
  from functools import wraps
  import pytest
  from sklearn import datasets
  import warnings
label_desc: Use image node_id 39 for calling a global function with example usage: test_hdbscan_allow_single_cluster_with_epsilon() without return types