Every time you iterate over a dataset, python triggers dataset.__iter__() method, which will under the hood your sampler’s .__iter__() method.
If you set DataLoader(..., shuffle=True) you are in practice instantiating a RandomSampler 30 inside the DataLoader. Thus, does not matter whether you iterate for few batches, epoch, or however you want to call it, every time you do:
for data, label in dataloader:  # iter -> triggers __iter__() -> shuffles data
    pass

Your data gets “shuffled” (internally, indexes pointing to different samples gets returned in random order).
The following Python code does trigger a similar behaviour:
iterator = iter(dataloader) # iter -> triggers __iter__() -> shuffles data
for i in range(100):
    images, labels = next(iterator)

Be careful in the last example, as if 100 > len(dataloader) it will trigger an exception (StopIteration), which is handled under the hood when you iterate over the dataset in a for loop, but not in this case.