def compute_affinity_matrix(self, copy=False, **kwargs):
        if self.adjacency_matrix is None:
            self.compute_adjacency_matrix()

        kwds = self.affinity_kwds.copy()
        kwds.update(kwargs)
        self.affinity_matrix = compute_affinity_matrix(self.adjacency_matrix,
                                                       self.affinity_method,
                                                       **kwds)
        if copy:
            return self.affinity_matrix.copy()
        else:
            return self.affinity_matrix
This function will compute the affinity matrix. In order to
dataset/ETHPy150Open mmp2/megaman/megaman/geometry/geometry.py/Geometry.compute_affinity_matrix