'Return the number of epochs.
Returns
n_epochs : int
The number of remaining epochs.
Notes
This function only works if bad epochs have been dropped.
Examples
This can be used as::
>>> epochs.drop_bad()  # doctest: +SKIP
>>> len(epochs)  # doctest: +SKIP
43
>>> len(epochs.events)  # doctest: +SKIP
43'

def __len__(self):

    if (not self._bad_dropped):
        raise RuntimeError('Since    bad    epochs    have    not    been    dropped,    the    length    of    the    Epochs    is    not    known.    Load    the    Epochs    with    preload=True,    or    call    Epochs.drop_bad().    To    find    the    number    of    events    in    the    Epochs,    use    len(Epochs.events).')
    return len(self.events)
