I have to admit, I’m not sure why it is done this way in this code. Maybe for historical reasons, he was trying other samplers before.
You can double check the doc here 37 to make sure what the behavior will be with shuffle or if you set the sampler.