docstr: Transform MNIST dataset by applying rotation to images.
  Attribute (rotation angle) is independent of label Y.
  
  :param images: original MNIST images
  :param angle: Value of rotation angle used for transforming the image
  :returns: transformed images
docstr_tok: ["Transform","MNIST","dataset","by","applying","rotation","to","images",".","Attribute","(","rotation","angle",")","is","independent","of","label","Y.",":","param","images",":","original","MNIST","images",":","param","angle",":","Value","of","rotation","angle","used","for","transforming","the","image",":","returns",":","transformed","images"]
code: def rotate_dataset(self, images, angle):
      """
      Transform MNIST dataset by applying rotation to images.
      Attribute (rotation angle) is independent of label Y.
  
      :param images: original MNIST images
      :param angle: Value of rotation angle used for transforming the image
      :returns: transformed images
      """
      rotation = transforms.Compose(
          [
              transforms.ToPILImage(),
              transforms.Lambda(
                  lambda x: transforms.functional.rotate(
                      x, int(angle), fill=(0,)
                  )
              ),
              transforms.ToTensor(),
          ]
      )
  
      x = torch.zeros(len(images), 14, 14)
      for i in range(len(images)):
          x[i] = rotation(images[i].float().div_(255.0))
      return x
  
imports: import torch
  import torchvision
  from PIL import Image
  from torch.utils.data import TensorDataset
  from torchvision import transforms
  from torchvision.datasets import MNIST
  from torchvision.transforms.functional import rotate
  from dowhy.causal_prediction.datasets.base_dataset import MultipleDomainDataset
label_desc: Use image node_id 4 for calling the MNISTCausalIndAttribute obj's underlying member method code with example usage: obj.rotate_dataset(images, angle) and returns: x