<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize(X, mean=None, std=None):
 """ Normalize X. If mean OR std is None, normalizes X to have mean 0 and std 1. """

    if mean is None or std is None:
        mean = X.mean(0)
        std = X.std(0)
    return (X - mean) / std