code: def validate(reference_onsets, estimated_onsets):
      
      # 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)
docs: 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