def _sample_anno(self):
        """Modified from https://github.com/webdataset/webdataset/blob/039d7431
        9ae55e5696dcef89829be9671802cf70/webdataset/shardlists.py#L281  #
        noqa."""
        self.epoch += 1
        if self.deterministic:
            seed = utils.make_seed(utils.pytorch_worker_seed() + self.epoch)
        else:
            seed = utils.make_seed(utils.pytorch_worker_seed(), self.epoch, os.getpid(), time.time_ns(), os.urandom(4))

        rng = random.Random(seed)

        for _ in range(len(self.anno_list)):
            index = rng.randint(0, len(self.anno_list) - 1)

            yield {"anno": self.anno_list[index], "index": index}
Modified from https://github.com/webdataset/webdataset/blob/039d7431
        9ae55e5696dcef89829be9671802cf70/webdataset/shardlists.py#L281  #
        noqa.
powerpaint/datasets/laion.py