code: def clusters(points, radius):
      
      from . import graph
      tree = cKDTree(points)
  
      # some versions return pairs as a set of tuples
      pairs = tree.query_pairs(r=radius, output_type='ndarray')
      # group connected components
      groups = graph.connected_components(pairs)
  
      return groups
docs: Find clusters of points which have neighbours closer than radius
  
      Parameters
      ---------
      points : (n, d) float
          Points of dimension d
      radius : float
          Max distance between points in a cluster
  
      Returns
      ----------
      groups : (m,) sequence of int
          Indices of points in a cluster