code: def _inv_dist(self, X, X2=None):
          
          dist = self._scaled_dist(X, X2).copy()
          return 1./np.where(dist != 0., dist, np.inf)
docs: Compute the elementwise inverse of the distance matrix, expecpt on the
          diagonal, where we return zero (the distance on the diagonal is zero).
          This term appears in derviatives.