code: def goto(
      detections,
      annotations,
      threshold=GOTO_THRESHOLD,
      sigma=GOTO_SIGMA,
      mu=GOTO_MU,
  ):
      """
      Calculate the Goto and Muraoka accuracy for the given detections and
      annotations.
  
      Parameters
      ----------
      detections : list or numpy array
          Detected beats.
      annotations : list or numpy array
          Annotated beats.
      threshold : float, optional
          Threshold.
      sigma : float, optional
          Allowed std. dev. of the errors in the longest segment.
      mu : float, optional
          Allowed mean. of the errors in the longest segment.
  
      Returns
      -------
      goto : float
          Goto beat tracking accuracy.
  
      Notes
      -----
      [1]_ requires that the first correct beat detection must occur within the
      first 3/4 of the excerpt. In order to be able to deal with audio with
      varying tempo, this was altered that the length of the longest continuously
      tracked segment must be at least 1/4 of the total length [2]_.
  
      References
      ----------
      .. [1] M. Goto and Y. Muraoka,
             "Issues in evaluating beat tracking systems",
             Working Notes of the IJCAI-97 Workshop on Issues in AI and Music -
             Evaluation and Assessment, 1997.
      .. [2] Matthew E. P. Davies, Norberto Degara, and Mark D. Plumbley,
             "Evaluation Methods for Musical Audio Beat Tracking Algorithms",
             Technical Report C4DM-TR-09-06,
             Centre for Digital Music, Queen Mary University of London, 2009.
  
      """
      # at least 2 annotations must be given to calculate an interval
      if len(annotations) < 2:
          raise BeatIntervalError(
              "At least 2 annotations are needed for Goto's " "score."
          )
      # threshold, sigma and mu must be greater than 0
      if float(threshold) <= 0 or float(sigma) <= 0 or float(mu) <= 0:
          raise ValueError("Threshold, sigma and mu must be positive.")
      # get the indices of the closest detections to the annotations to determine
      # the longest continuous segment
      closest = find_closest_matches(annotations, detections)
      # keep only those which have abs(errors) <= threshold
      # Note: both the original paper and the Matlab implementation normalize by
      #       half a beat interval, thus our threshold is halved (same applies to
      #       sigma and mu)
      # errors of the detections relative to the surrounding annotation interval
      errors = calc_relative_errors(detections, annotations)
      # the absolute error must be smaller than the given threshold
      closest = closest[np.abs(errors[closest]) <= threshold]
      # get the length and start position of the longest continuous segment
      length, start = find_longest_continuous_segment(closest)
      # three conditions must be met to identify the segment as correct
      # 1) the length of the segment must be at least 1/4 of the total length
      # Note: the original paper requires that the first element must occur
      #       within the first 3/4 of the excerpt, but this was altered in the
      #       Matlab implementation to the above condition to be able to deal
      #       with audio with varying tempo
      if length < 0.25 * len(annotations):
          return 0.0
      # errors of the longest segment
      segment_errors = errors[closest[start : start + length]]
      # 2) mean of the errors must not exceed mu
      if np.mean(np.abs(segment_errors)) > mu:
          return 0.0
      # 3) std deviation of the errors must not exceed sigma
      # Note: contrary to the original paper and in line with the Matlab code,
      #       we calculate the std. deviation based on the raw errors and not on
      #       their absolute values.
      if np.std(segment_errors) > sigma:
          return 0.0
      # otherwise return 1
      return 1.0
  
imports: from __future__ import absolute_import, division, print_function
  import warnings
  from functools import wraps
  import numpy
  from .None import MeanEvaluation, calc_absolute_errors, calc_errors, evaluation_io, find_closest_matches
  from .onsets import OnsetEvaluation
label_desc: Use image node_id 10 for calling a global function with example usage: goto(detections, annotations, threshold, sigma, mu) and returns: int, int, int, int