code: def test_approx_predict_same_clusters():
      """
      Verify that approximate_predict_flat produces as many clusters as clusterer
      """
      # Given a flat clustering trained for some n_clusters,
      n_clusters = 5
      clusterer = HDBSCAN_flat(
          X, cluster_selection_method="eom", n_clusters=n_clusters
      )
  
      # When using approximate_predict_flat without specifying n_clusters,
      labels_flat, proba_flat = approximate_predict_flat(
          clusterer, X_test, n_clusters=None
      )
  
      # Then, the number of clusters produced must match the original n_clusters
      n_clusters_out = n_clusters_from_labels(labels_flat)
      assert n_clusters_out == n_clusters
      # and all probabilities are <= 1.
      assert_array_less(proba_flat, np.ones(len(proba_flat)) + 1.0e-14)
      return
  
file_path: hdbscan/hdbscan/tests/test_flat.py
imports: import warnings
  import numpy
  from hdbscan import HDBSCAN, approximate_predict
  from hdbscan.flat import HDBSCAN_flat, approximate_predict_flat, membership_vector_flat, all_points_membership_vectors_flat
  from sklearn.datasets import make_blobs, make_moons
  from sklearn.preprocessing import StandardScaler
  from sklearn.model_selection import train_test_split
  from sklearn.utils._testing import assert_array_equal, assert_array_less
label_desc: Use image node_id 6 for calling a global function with example usage: test_approx_predict_same_clusters() without return types