code: def fetch(dataset, annot, cat=(0, 0, 0, 0), evt_type=None, stage=None,
            cycle=None, chan_full=None, epoch=None, epoch_dur=30,
            epoch_overlap=0, epoch_step=None, reject_epoch=False,
            reject_artf=False, min_dur=0, buffer=0):
      bundles = get_times(annot, evt_type=evt_type, stage=stage, cycle=cycle,
                          chan=chan_full, exclude=reject_epoch, buffer=buffer)
      if reject_artf and bundles:
          for bund in bundles:
              bund['times'] = remove_artf_evts(bund['times'], annot, 
                  bund['chan'], min_dur=0)
      if bundles:
          if 'locked' == epoch:
              bundles = _divide_bundles(bundles)
          elif 'unlocked' == epoch:
              if epoch_step is not None:
                  step = epoch_step
              else:
                  step = epoch_dur - (epoch_dur * epoch_overlap)
              bundles = _concat(bundles, cat)
              bundles = _find_intervals(bundles, epoch_dur, step)
          elif not epoch:
              bundles = _concat(bundles, cat)
          bundles = _longer_than(bundles, min_dur)
      segments = Segments(dataset)
      segments.segments = bundles
      return segments