<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensure_wide_weights_is_1D_or_2D_ndarray(wide_weights):
 """ Ensures that `wide_weights` is a 1D or 2D ndarray. Raises a helpful ValueError if otherwise. """

    if not isinstance(wide_weights, np.ndarray):
        msg = "wide_weights MUST be a ndarray."
        raise ValueError(msg)
    ndim = wide_weights.ndim
    if not 0 < ndim < 3:
        msg = "wide_weights MUST be a 1D or 2D ndarray."
        raise ValueError(msg)
    return None