def __getitem__(self, index):
        """
        Args:
            index (int): Index

        Returns:
            tuple: (sample, target) where target is class_index of the target
            class.
        """
        fpath, target = self.samples[index][-1], self.targets[index]
        sample = self.loader(str(self.root / fpath))
        if self.bbox_crop:
            bbox = self.samples[index][-2]
            cw = bbox[0] - bbox[1]
            ch = bbox[2] - bbox[3]
            center = [int(bbox[1] + cw / 2), int(bbox[3] + ch / 2)]
            bbox = [
                min([int(center[0] + (cw * self.ratio / 2)), sample.size[0]]),
                max([int(center[0] - (cw * self.ratio / 2)), 0]),
                min([int(center[1] + (ch * self.ratio / 2)), sample.size[1]]),
                max([int(center[1] - (ch * self.ratio / 2)), 0]),
            ]
            sample = sample.crop((bbox[1], bbox[3], bbox[0], bbox[2]))

        if self.transform is not None:
            sample = self.transform(sample)
        if self.target_transform is not None:
            target = self.target_transform(target)

        return sample, target

        Args:
            index (int): Index

        Returns:
            tuple: (sample, target) where target is class_index of the target
            class.
        
avalanche/benchmarks/datasets/stream51/stream51.py