# Path: note_seq/events_lib.py
# DEFAULT_STEPS_PER_BAR = constants.DEFAULT_STEPS_PER_BAR
# DEFAULT_STEPS_PER_QUARTER = constants.DEFAULT_STEPS_PER_QUARTER
# STANDARD_PPQ = constants.STANDARD_PPQ
# class NonIntegerStepsPerBarError(Exception):
# class EventSequence(object):
# class SimpleEventSequence(EventSequence):
#   def start_step(self):
#   def end_step(self):
#   def steps(self):
#   def append(self, event):
#   def set_length(self, steps, from_left=False):
#   def __getitem__(self, i):
#   def __iter__(self):
#   def __len__(self):
#   def __init__(self, pad_event, events=None, start_step=0,
#                steps_per_bar=DEFAULT_STEPS_PER_BAR,
#                steps_per_quarter=DEFAULT_STEPS_PER_QUARTER):
#   def _reset(self):
#   def _from_event_list(self, events, start_step=0,
#                        steps_per_bar=DEFAULT_STEPS_PER_BAR,
#                        steps_per_quarter=DEFAULT_STEPS_PER_QUARTER):
#   def __iter__(self):
#   def __getitem__(self, key):
#   def __len__(self):
#   def __deepcopy__(self, memo=None):
#   def __eq__(self, other):
#   def start_step(self):
#   def end_step(self):
#   def steps(self):
#   def steps_per_bar(self):
#   def steps_per_quarter(self):
#   def append(self, event):
#   def set_length(self, steps, from_left=False):
#   def increase_resolution(self, k, fill_event=None):


import copy
from absl.testing import absltest
from note_seq import events_lib
    self.assertListEqual([0, 0, 0, 0, 60],
                         list(events))
    self.assertEqual(5, events.start_step)
    self.assertEqual(10, events.end_step)
    self.assertListEqual([5, 6, 7, 8, 9], events.steps)

    events = events_lib.SimpleEventSequence(pad_event=0, events=[60, 0, 0, 0])
    events.set_length(3)
    self.assertListEqual([60, 0, 0], list(events))
    self.assertEqual(0, events.start_step)
    self.assertEqual(3, events.end_step)
    self.assertListEqual([0, 1, 2], events.steps)

    events = events_lib.SimpleEventSequence(pad_event=0, events=[60, 0, 0, 0])
    events.set_length(3, from_left=True)
    self.assertListEqual([0, 0, 0], list(events))
    self.assertEqual(1, events.start_step)
    self.assertEqual(4, events.end_step)
    self.assertListEqual([1, 2, 3], events.steps)

  def testIncreaseResolution(self):
    events = events_lib.SimpleEventSequence(pad_event=0, events=[1, 0, 1, 0],
                                            start_step=5, steps_per_bar=4,
                                            steps_per_quarter=1)
    events.increase_resolution(3, fill_event=None)
    self.assertListEqual([1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0], list(events))
    self.assertEqual(events.start_step, 15)
    self.assertEqual(events.steps_per_bar, 12)
    self.assertEqual(events.steps_per_quarter, 3)


# Path: note_seq/events_lib.py
# DEFAULT_STEPS_PER_BAR = constants.DEFAULT_STEPS_PER_BAR
# DEFAULT_STEPS_PER_QUARTER = constants.DEFAULT_STEPS_PER_QUARTER
# STANDARD_PPQ = constants.STANDARD_PPQ
# class NonIntegerStepsPerBarError(Exception):
# class EventSequence(object):
# class SimpleEventSequence(EventSequence):
#   def start_step(self):
#   def end_step(self):
#   def steps(self):
#   def append(self, event):
#   def set_length(self, steps, from_left=False):
#   def __getitem__(self, i):
#   def __iter__(self):
#   def __len__(self):
#   def __init__(self, pad_event, events=None, start_step=0,
#                steps_per_bar=DEFAULT_STEPS_PER_BAR,
#                steps_per_quarter=DEFAULT_STEPS_PER_QUARTER):
#   def _reset(self):
#   def _from_event_list(self, events, start_step=0,
#                        steps_per_bar=DEFAULT_STEPS_PER_BAR,
#                        steps_per_quarter=DEFAULT_STEPS_PER_QUARTER):
#   def __iter__(self):
#   def __getitem__(self, key):
#   def __len__(self):
#   def __deepcopy__(self, memo=None):
#   def __eq__(self, other):
#   def start_step(self):
#   def end_step(self):
#   def steps(self):
#   def steps_per_bar(self):
#   def steps_per_quarter(self):
#   def append(self, event):
#   def set_length(self, steps, from_left=False):
#   def increase_resolution(self, k, fill_event=None):


# Path: note_seq/events_lib_test.py
import copy
from absl.testing import absltest
from note_seq import events_lib

    self.assertListEqual([0, 0, 0, 0, 60],
                         list(events))
    self.assertEqual(5, events.start_step)
    self.assertEqual(10, events.end_step)
    self.assertListEqual([5, 6, 7, 8, 9], events.steps)

    events = events_lib.SimpleEventSequence(pad_event=0, events=[60, 0, 0, 0])
    events.set_length(3)
    self.assertListEqual([60, 0, 0], list(events))
    self.assertEqual(0, events.start_step)
    self.assertEqual(3, events.end_step)
    self.assertListEqual([0, 1, 2], events.steps)

    events = events_lib.SimpleEventSequence(pad_event=0, events=[60, 0, 0, 0])
    events.set_length(3, from_left=True)
    self.assertListEqual([0, 0, 0], list(events))
    self.assertEqual(1, events.start_step)
    self.assertEqual(4, events.end_step)
    self.assertListEqual([1, 2, 3], events.steps)

  def testIncreaseResolution(self):
    events = events_lib.SimpleEventSequence(pad_event=0, events=[1, 0, 1, 0],
                                            start_step=5, steps_per_bar=4,
                                            steps_per_quarter=1)
    events.increase_resolution(3, fill_event=None)
    self.assertListEqual([1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0], list(events))
    self.assertEqual(events.start_step, 15)
    self.assertEqual(events.steps_per_bar, 12)
    self.assertEqual(events.steps_per_quarter, 3)


    events = events_lib.SimpleEventSequence(pad_event=0, events=[1, 0, 1, 0])