code: def test_clusteringcase():
      from ultranest.mlfriends import update_clusters
  
      here = os.path.dirname(__file__)
      points = np.loadtxt(os.path.join(here, "clusters2.txt"))
      maxr = np.loadtxt(os.path.join(here, "clusters2_radius.txt"))
      # transformLayer = ScalingLayer()
      # transformLayer.optimize(points)
      # region = MLFriends(points, transformLayer)
      # maxr = region.compute_maxradiussq(nbootstraps=30)
      print("maxradius:", maxr)
      nclusters, clusteridxs, overlapped_points = update_clusters(
          points, points, maxr
      )
  
      plt.title("nclusters: %d" % nclusters)
      for i in np.unique(clusteridxs):
          x, y = points[clusteridxs == i].transpose()
          plt.scatter(x, y)
      plt.savefig("testclustering_2.pdf", bbox_inches="tight")
      plt.close()
  
file_path: ultranest/tests/test_clustering.py
imports: from __future__ import print_function, division
  import numpy
  import os
  import matplotlib.pyplot
  from ultranest.utils import create_logger
  from ultranest import ReactiveNestedSampler
  from ultranest.mlfriends import MLFriends, AffineLayer
label_desc: Use image node_id 2 for calling a global function with example usage: test_clusteringcase() without return types