<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(reference_onsets, estimated_onsets):
 """Checks that the input annotations to a metric look like valid onset time arrays, and throws helpful errors if not. Parameters reference_onsets : np.ndarray reference onset locations, in seconds estimated_onsets : np.ndarray estimated onset locations, in seconds """

    # If reference or estimated onsets are empty, warn because metric will be 0
    if reference_onsets.size == 0:
        warnings.warn("Reference onsets are empty.")
    if estimated_onsets.size == 0:
        warnings.warn("Estimated onsets are empty.")
    for onsets in [reference_onsets, estimated_onsets]:
        util.validate_events(onsets, MAX_TIME)