code: def validate(ref_time, ref_freqs, est_time, est_freqs):
      util.validate_events(ref_time, max_time=MAX_TIME)
      util.validate_events(est_time, max_time=MAX_TIME)
      if ref_time.size == 0:
          warnings.warn("Reference times are empty.")
      if ref_time.ndim != 1:
          raise ValueError("Reference times have invalid dimension")
      if len(ref_freqs) == 0:
          warnings.warn("Reference frequencies are empty.")
      if est_time.size == 0:
          warnings.warn("Estimated times are empty.")
      if est_time.ndim != 1:
          raise ValueError("Estimated times have invalid dimension")
      if len(est_freqs) == 0:
          warnings.warn("Estimated frequencies are empty.")
      if ref_time.size != len(ref_freqs):
          raise ValueError('Reference times and frequencies have unequal '
                           'lengths.')
      if est_time.size != len(est_freqs):
          raise ValueError('Estimate times and frequencies have unequal '
                           'lengths.')
      for freq in ref_freqs:
          util.validate_frequencies(freq, max_freq=MAX_FREQ, min_freq=MIN_FREQ,
                                    allow_negatives=False)
      for freq in est_freqs:
          util.validate_frequencies(freq, max_freq=MAX_FREQ, min_freq=MIN_FREQ,
                                    allow_negatives=False)