class_docstr: Load beat times from file or handle.
class_docstr_tok: ["Load","beat","times","from","file","or","handle","."]
docstr: Load beat times from file.
  
  First match the given input filename to the beat filenames, then load
  the beats.
  
  Parameters
  ----------
  filename : str
      Input file name.
  
  Returns
  -------
  beats : numpy array
      Beat positions [seconds].
  
  Notes
  -----
  Both the file names to search for the beats as well as the suffix to
  determine the beat files must be given at instantiation time.
code: def process_batch(self, filename):
      """
      Load beat times from file.
  
      First match the given input filename to the beat filenames, then load
      the beats.
  
      Parameters
      ----------
      filename : str
          Input file name.
  
      Returns
      -------
      beats : numpy array
          Beat positions [seconds].
  
      Notes
      -----
      Both the file names to search for the beats as well as the suffix to
      determine the beat files must be given at instantiation time.
  
      """
      import os
      from ..utils import match_file
  
      if not isinstance(filename, string_types):
          raise SystemExit(
              "Please supply a filename, not %s." % filename
          )
      # select the matching beat file to a given input file from all files
      basename, ext = os.path.splitext(os.path.basename(filename))
      matches = match_file(
          basename,
          self.beats,
          suffix=ext,
          match_suffix=self.beats_suffix,
      )
      if not matches:
          raise SystemExit("can't find a beat file for %s" % filename)
      # load the beats and return them
      # TODO: Use load_beats function
      beats = np.loadtxt(matches[0])
      if beats.ndim == 2:
          # only use beat times, omit the beat positions inside the bar
          beats = beats[:, 0]
      return beats
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  import warnings
  import numpy
  from .beats import threshold_activations
  from .beats_hmm import BarStateSpace, BarTransitionModel, GMMPatternTrackingObservationModel, MultiPatternStateSpace, MultiPatternTransitionModel, RNNBeatTrackingObservationModel, RNNDownBeatTrackingObservationModel
  from ..ml.hmm import HiddenMarkovModel
  from ..processors import ParallelProcessor, Processor, SequentialProcessor
  from ..utils import string_types
label_desc: Use image node_id 4 for calling the LoadBeatsProcessor obj's underlying member method code with example usage: obj.process_batch(filename) and returns: beats