def normalize(X, axis=(- 1), order=2):
    l2 = np.atleast_1d(np.linalg.norm(X, order, axis))
    l2[(l2 == 0)] = 1
    return (X / np.expand_dims(l2, axis))
def normalize(X, axis=(- 1), order=2):
    l2 = np.atleast_1d(np.linalg.norm(X, order, axis))
    l2[(l2 == 0)] = 1
    return (X / np.expand_dims(l2, axis))