code: def _weightfun_spatial_distance(data, params, report):
      
      distance = getDistanceFunction(params['distance'])
      weights = np.array([distance(data[n, :], data[t, :]) for n in np.arange(
          0, data.shape[0]) for t in np.arange(0, data.shape[0])])
      weights = np.reshape(weights, [data.shape[0], data.shape[0]])
      np.fill_diagonal(weights, np.nan)
      weights = 1 / weights
      weights = (weights - np.nanmin(weights)) / \
          (np.nanmax(weights) - np.nanmin(weights))
      np.fill_diagonal(weights, 1)
      return weights, report
docs: Creates the weights for the spatial distance method. See func: teneto.derive.derive.