<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate(ref_intervals, ref_pitches, est_intervals, est_pitches):
 """Checks that the input annotations to a metric look like time intervals and a pitch list, and throws helpful errors if not. Parameters ref_intervals : np.ndarray, shape=(n,2) Array of reference notes time intervals (onset and offset times) ref_pitches : np.ndarray, shape=(n,) Array of reference pitch values in Hertz est_intervals : np.ndarray, shape=(m,2) Array of estimated notes time intervals (onset and offset times) est_pitches : np.ndarray, shape=(m,) Array of estimated pitch values in Hertz """

    # Validate intervals
    validate_intervals(ref_intervals, est_intervals)

    # Make sure intervals and pitches match in length
    if not ref_intervals.shape[0] == ref_pitches.shape[0]:
        raise ValueError('Reference intervals and pitches have different '
                         'lengths.')
    if not est_intervals.shape[0] == est_pitches.shape[0]:
        raise ValueError('Estimated intervals and pitches have different '
                         'lengths.')

    # Make sure all pitch values are positive
    if ref_pitches.size > 0 and np.min(ref_pitches) <= 0:
        raise ValueError("Reference contains at least one non-positive pitch "
                         "value")
    if est_pitches.size > 0 and np.min(est_pitches) <= 0:
        raise ValueError("Estimate contains at least one non-positive pitch "
                         "value")