def sqeuclidean(u, v):
 (utype, vtype) = (None, None)
 if (not (hasattr(u, 'dtype') and np.issubdtype(u.dtype, np.inexact))):
  utype = np.float64
 if (not (hasattr(v, 'dtype') and np.issubdtype(v.dtype, np.inexact))):
  vtype = np.float64
 u = _validate_vector(u, dtype=utype)
 v = _validate_vector(v, dtype=vtype)
 u_v = (u - v)
 return np.dot(u_v, u_v)

def sqeuclidean ( u , v ) : ( utype , vtype ) = ( None , None ) if ( not ( hasattr ( u , 'dtype' ) and np . issubdtype ( u . dtype , np . inexact ) ) ) : utype = np . float64 if ( not ( hasattr ( v , 'dtype' ) and np . issubdtype ( v . dtype , np . inexact ) ) ) : vtype = np . float64 u = _validate_vector ( u , dtype = utype ) v = _validate_vector ( v , dtype = vtype ) u_v = ( u - v ) return np . dot ( u_v , u_v )
computes the squared euclidean distance between two 1-d arrays .