def paired_distances(X, Y, metric='euclidean', **kwds):
 if (metric in PAIRED_DISTANCES):
  func = PAIRED_DISTANCES[metric]
  return func(X, Y)
 elif callable(metric):
  (X, Y) = check_paired_arrays(X, Y)
  distances = np.zeros(len(X))
  for i in range(len(X)):
   distances[i] = metric(X[i], Y[i])
  return distances
 else:
  raise ValueError(('Unknown distance %s' % metric))

def paired_distances ( X , Y , metric = 'euclidean' , ** kwds ) : if ( metric in PAIRED_DISTANCES ) : func = PAIRED_DISTANCES [ metric ] return func ( X , Y ) elif callable ( metric ) : ( X , Y ) = check_paired_arrays ( X , Y ) distances = np . zeros ( len ( X ) ) for i in range ( len ( X ) ) : distances [ i ] = metric ( X [ i ] , Y [ i ] ) return distances else : raise ValueError ( ( 'Unknown distance %s' % metric ) )
computes the paired distances between x and y .