def _center_scale_xy(X, Y, scale=True):
 x_mean = X.mean(axis=0)
 X -= x_mean
 y_mean = Y.mean(axis=0)
 Y -= y_mean
 if scale:
  x_std = X.std(axis=0, ddof=1)
  x_std[(x_std == 0.0)] = 1.0
  X /= x_std
  y_std = Y.std(axis=0, ddof=1)
  y_std[(y_std == 0.0)] = 1.0
  Y /= y_std
 else:
  x_std = np.ones(X.shape[1])
  y_std = np.ones(Y.shape[1])
 return (X, Y, x_mean, y_mean, x_std, y_std)

def _center_scale_xy ( X , Y , scale = True ) : x_mean = X . mean ( axis = 0 ) X -= x_mean y_mean = Y . mean ( axis = 0 ) Y -= y_mean if scale : x_std = X . std ( axis = 0 , ddof = 1 ) x_std [ ( x_std == 0.0 ) ] = 1.0 X /= x_std y_std = Y . std ( axis = 0 , ddof = 1 ) y_std [ ( y_std == 0.0 ) ] = 1.0 Y /= y_std else : x_std = np . ones ( X . shape [ 1 ] ) y_std = np . ones ( Y . shape [ 1 ] ) return ( X , Y , x_mean , y_mean , x_std , y_std )
center x .