How to use one dataloader for two dataset?

I have dataset 1 and dataset 2 that store in two lists.

  • list_dataset1
  • list_dataset2

I want to write a custom dataset loader that can shuffle two dataset. For example, the two first epochs, it will return the index likes

dataset1, dataset2


dataset1, dataset2


So, this is my dataloader

class Mydataloader(data.Dataset):

    def __init__(self, list_dataloader1, list_dataloader2):
    def __getitem__(self, index):    
         return self.list_dataloader1[index],self.list_dataloader2[index]
    def __len__(self):
        return len(self.list_dataloader1)

The above script only shuffles the dataloader1, not data loader 2. How can I shuffle both together?