original_docstring: Segmentize raw data into list of epochs.
  
      returns dataset and label_array : a list of data, each block is 1
          second, with fixed size. width is number of channels in certain standard
          order.
  
      Args:
          raw: EEG signals. Shape: (n_channel, n_sample).
          fsamp(int): sampling rate, i.e., window size of resulting epoch. Unit: Hz
          intvs: list of [start, end]. Unit: second
          labels: list of labels. Must be same len as INTVS
  
      Returns: tuple (dataset, labels):
              - dataset: list of data; (n_epochs, n_channels, n_sample_per_epoch)
              - labels: list of labels
  
      
docstring: Segmentize raw data into list of epochs.
  returns dataset and label_array : a list of data, each block is 1
  second, with fixed size. width is number of channels in certain standard
  order.
docstring_tokens: Segmentize raw data into list of epochs . returns dataset and label_array : a list of data each block is 1 second with fixed size . width is number of channels in certain standard order .
code: def signal_to_dataset(raw, fsamp, intvs, labels):
      """Segmentize raw data into list of epochs.
  
      returns dataset and label_array : a list of data, each block is 1
          second, with fixed size. width is number of channels in certain standard
          order.
  
      Args:
          raw: EEG signals. Shape: (n_channel, n_sample).
          fsamp(int): sampling rate, i.e., window size of resulting epoch. Unit: Hz
          intvs: list of [start, end]. Unit: second
          labels: list of labels. Must be same len as INTVS
  
      Returns: tuple (dataset, labels):
              - dataset: list of data; (n_epochs, n_channels, n_sample_per_epoch)
              - labels: list of labels
  
      """
      ds, lbl = [], []
      for i, inv in enumerate(intvs):
          tstart, tend = inv
          chopped_sig = chop_signal(
              [ch[math.ceil(tstart*fsamp):math.floor(tend*fsamp)] for ch in raw],
              fsamp)
          ds.extend(chopped_sig)
          lbl.extend([labels[i]] * len(chopped_sig))
      return ds, lbl
code_tokens: def signal_to_dataset ( raw , fsamp , intvs , labels ) : ds , lbl = [ ] , [ ] for i , inv in enumerate ( intvs ) : tstart , tend = inv chopped_sig = chop_signal ( [ ch [ math . ceil ( tstart * fsamp ) : math . floor ( tend * fsamp ) ] for ch in raw ] , fsamp ) ds . extend ( chopped_sig ) lbl . extend ( [ labels [ i ] ] * len ( chopped_sig ) ) return ds , lbl
short_docstring: Segmentize raw data into list of epochs.
short_docstring_tokens: Segmentize raw data into list of epochs .
comment: """Segmentize raw data into list of epochs.
  
      returns dataset and label_array : a list of data, each block is 1
          second, with fixed size. width is number of channels in certain standard
          order.
  
      Args:
          raw: EEG signals. Shape: (n_channel, n_sample).
          fsamp(int): sampling rate, i.e., window size of resulting epoch. Unit: Hz
          intvs: list of [start, end]. Unit: second
          labels: list of labels. Must be same len as INTVS
  
      Returns: tuple (dataset, labels):
              - dataset: list of data; (n_epochs, n_channels, n_sample_per_epoch)
              - labels: list of labels
  
      """