def get_clusters(self, *inflation):
        """Return clusters formed by close objects.

        Parameters
        ==========
        inflation (two integers or iterable containing them)
            amount of size to inflate each object's rect
            in order to check by collision whether they
            are close enough to be considered in the same
            cluster.
        """
        ### define map associating the id of a rect to the
        ### object to which it belongs

        rect_id_to_obj = {id(obj.rect): obj for obj in self}

        ### for each cluster yielded (list of rects), yield
        ### a new list containing the objects associated with
        ### the rects in the cluster

        for cluster in self.rect.get_clusters(*inflation):

            yield [rect_id_to_obj[id(rect)] for rect in cluster]
Return clusters formed by close objects.

        Parameters
        ==========
        inflation (two integers or iterable containing them)
            amount of size to inflate each object's rect
            in order to check by collision whether they
            are close enough to be considered in the same
            cluster.
        
nodezator/classes2d/collections.py