def __getitem__(self, index):
if self.labels is not None:<EOL><INDENT>img, target = self.data[index], int(self.labels[index])<EOL><DEDENT>else:<EOL><INDENT>img, target = self.data[index], None<EOL><DEDENT>img = Image.fromarray(np.transpose(img, (<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:0>)))<EOL>if self.transform is not None:<EOL><INDENT>img = self.transform(img)<EOL><DEDENT>if self.target_transform is not None:<EOL><INDENT>target = self.target_transform(target)<EOL><DEDENT>return img, target<EOL>
Args:
    index (int): Index

Returns:
    tuple: (image, target) where target is index of the target class.