code: def slice(self, startTimes, endTimes):
      nSlices = len(startTimes)
      if nSlices != len(endTimes):
          print("Test cannot be computed")
          exit(1)
      input = list(range(max(endTimes)))
  
      # expected values:
      expected = []
      orderedTimes = []
      for i in range(nSlices):
          time = (startTimes[i], endTimes[i])
          orderedTimes.append(time)
      orderedTimes = sorted(orderedTimes, key=lambda x: x[0])
  
      for i in range(nSlices):
          expected.append(
              input[orderedTimes[i][0] : orderedTimes[i][1]]
          )
  
      result = Slicer(
          startTimes=startTimes, endTimes=endTimes, timeUnits="samples"
      )(input)
  
      self.assertEqual(len(result), len(expected))
      for i in range(nSlices):
          self.assertEqualVector(result[i], expected[i])
  
file_path: essentia/test/src/unittests/standard/test_slicer.py
imports: from essentia_test import *
  from essentia import *
  from numpy import sort
label_desc: Use image node_id 1 for calling the TestSlicer obj's underlying member method code with example usage: obj.slice(startTimes, endTimes) without return types