Trying to get new list of indices using custom batch sampler

I have several Datasets merged into one large dataset. I am attempting to create a batch sampler such that I receive a list of indices corresponding to the separate datasets within my merged dataset. I need the first index from the list to always come from the 1st dataset, 2nd always come from the 2nd dataset and so on.

class BatchSamplerIndicies(Sampler):
    def __init__(self):
        self.dataset1 = list(range(0,1505))
        self.dataset2 = list(range(1505,2328))
        self.dataset3 = list(range(2328,3442))
        self.dataset4 = list(range(3442,8293))
      
    def __iter__(self):

        index1 = chunk(self.dataset1)
        index2 = chunk(self.dataset2)
        index3 = chunk(self.dataset3)
        index4 = chunk(self.dataset4)
       
        combined = [index1,index2, index3, index4] 
        return iter(combined)
    def __len__(self):
        return(len(self.dataset1) + len(self.dataset2) + len(self.dataset3) +len(self.dataset4) )

The code above does provide the shuffled list of indices, however when reading it into a DataLoader, and attempting to view the chosen indices, I recieve the error

dl=DataLoader(merged_datasets, batch_sampler=BatchSamplerIndicies())
next(iter(dl))
TypeError: 'int' object is not iterable

I assume the combined list isn’t the proper way to get the batch of indices in the strict order that I need them. How would I go about fixing this?