code: def variations(
      sequence,
      offbeat=False,
      double=False,
      half=False,
      triple=False,
      third=False,
  ):
      """
      Create variations of the given beat sequence.
  
      Parameters
      ----------
      sequence : numpy array
          Beat sequence.
      offbeat : bool, optional
          Create an offbeat sequence.
      double : bool, optional
          Create a double tempo sequence.
      half : bool, optional
          Create half tempo sequences (includes offbeat version).
      triple : bool, optional
          Create triple tempo sequence.
      third : bool, optional
          Create third tempo sequences (includes offbeat versions).
  
      Returns
      -------
      list
          Beat sequence variations.
  
      """
      # create different variants of the annotations
      sequences = []
      # double/half and offbeat variation
      if double or offbeat:
          if len(sequence) == 0:
              # if we have an empty sequence, there's nothing to interpolate
              double_sequence = []
          else:
              # create a sequence with double tempo
              same = np.arange(0, len(sequence))
              # request one item less, otherwise we would extrapolate
              shifted = np.arange(0, len(sequence), 0.5)[:-1]
              double_sequence = np.interp(shifted, same, sequence)
          # same tempo, half tempo off
          if offbeat:
              sequences.append(double_sequence[1::2])
          # double/half tempo variations
          if double:
              # double tempo
              sequences.append(double_sequence)
      if half:
          # half tempo odd beats (i.e. 1,3,1,3,..)
          sequences.append(sequence[0::2])
          # half tempo even beats (i.e. 2,4,2,4,..)
          sequences.append(sequence[1::2])
      # triple/third tempo variations
      if triple:
          if len(sequence) == 0:
              # if we have an empty sequence, there's nothing to interpolate
              triple_sequence = []
          else:
              # create a annotation sequence with triple tempo
              same = np.arange(0, len(sequence))
              # request two items less, otherwise we would extrapolate
              shifted = np.arange(0, len(sequence), 1.0 / 3)[:-2]
              triple_sequence = np.interp(shifted, same, sequence)
          # triple tempo
          sequences.append(triple_sequence)
      if third:
          # third tempo 1st beat (1,4,3,2,..)
          sequences.append(sequence[0::3])
          # third tempo 2nd beat (2,1,4,3,..)
          sequences.append(sequence[1::3])
          # third tempo 3rd beat (3,2,1,4,..)
          sequences.append(sequence[2::3])
      # return
      return sequences
  
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 3 for calling a global function with example usage: variations(sequence, offbeat, double, half, triple, third) and returns: sequences