<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def f_measure(reference_beats, estimated_beats, f_measure_threshold=0.07):
 """Compute the F-measure of correct vs incorrectly predicted beats. "Correctness" is determined over a small window. Examples -------- estimated_beats) Parameters reference_beats : np.ndarray reference beat times, in seconds estimated_beats : np.ndarray estimated beat times, in seconds f_measure_threshold : float Window size, in seconds (Default value = 0.07) Returns ------- f_score : float The computed F-measure score """

    validate(reference_beats, estimated_beats)
    # When estimated beats are empty, no beats are correct; metric is 0
    if estimated_beats.size == 0 or reference_beats.size == 0:
        return 0.
    # Compute the best-case matching between reference and estimated locations
    matching = util.match_events(reference_beats,
                                 estimated_beats,
                                 f_measure_threshold)

    precision = float(len(matching))/len(estimated_beats)
    recall = float(len(matching))/len(reference_beats)
    return util.f_measure(precision, recall)