Custom Dataset error: Lagged timeseries data

I am trying to implement a custom dataset for analyzing time series, but get the following error

class Data(Dataset):
    def __init__(self, data, labels, window): = data
        self.labels = labels
        self.window = window
    def __len__(self):
        return len(self.labels)-self.window
    def __getitem__(self, index):
        item =[index:index + self.window]
        label = self.labels[index+self.window] 
        return item, label
        8     def __getitem__(self, index):
---->   9         item =[index:index + self.window]
       10         label = self.labels[index+self.window]
       11         return item, label

TypeError: unsupported operand type(s) for +: 'slice' and 'int'