code: def __last_beat(cumscore):
      """Get the last beat from the cumulative score array"""
      maxes = util.localmax(cumscore)
      med_score = np.median(cumscore[np.argwhere(maxes)])
  
      # The last of these is the last beat (since score generally increases)
      return np.argwhere((cumscore * maxes * 2 > med_score)).max()
  
file_path: librosa/librosa/beat.py
imports: import numpy
  import scipy
  import scipy.stats
  from ._cache import cache
  from .None import core
  from .None import onset
  from .None import util
  from .feature import tempogram, fourier_tempogram
  from .feature import tempo
  from .util.exceptions import ParameterError
  from .util.decorators import moved
  from typing import Any, Callable, Optional, Tuple
label_desc: Use image node_id 7 for calling a global function with example usage: __last_beat(cumscore) and returns: np