def __call__(self, metric, weights=None, ndim=2, **extras):
    'Return a covariance matrix, given a metric.  Optionally, multiply\n        the output kernel by a weight function to induce non-stationarity.\n        '
    k = self.construct_kernel(metric)
    if (ndim != k.ndim):
        k = np.diag(k)
    if (weights is None):
        return k
    elif (ndim == 2):
        Sigma = ((weights[None, :] * k) * weights[:, None])
    else:
        Sigma = (k * (weights ** 2))
    return Sigma
Return a covariance matrix, given a metric.  Optionally, multiply
the output kernel by a weight function to induce non-stationarity.
def __call__(self, metric, weights=None, ndim=2, **extras):
    'Return a covariance matrix, given a metric.  Optionally, multiply\n        the output kernel by a weight function to induce non-stationarity.\n        '
    k = self.construct_kernel(metric)
    if (ndim != k.ndim):
        k = np.diag(k)
    if (weights is None):
        return k
    elif (ndim == 2):
        Sigma = ((weights[None, :] * k) * weights[:, None])
    else:
        Sigma = (k * (weights ** 2))
    return Sigma