code: def _find_intervals(bundles, duration, step):
      
      segments = []
      for bund in bundles:
          beg, end = bund['times'][0][0], bund['times'][-1][1]
  
          if end - beg >= duration:
              new_begs = arange(beg, end - duration, step)
  
              for t in new_begs:
                  seg = bund.copy()
                  seg['times'] = [(t, t + duration)]
                  segments.append(seg)
  
      return segments
docs: Divide bundles into segments of a certain duration and a certain step,
      discarding any remainder.