def _sample_proportional(self, batch_size):
        """
        This is a helper function to sample expriences with probabilities 
        proportional to their priorities.
        Returns a list of indices.
        """
        res = []
        for _ in range(batch_size):
            mass = random.random() * self._it_sum.sum(0, len(self._storage) - 1)
            idx = self._it_sum.find_prefixsum_idx(mass)
            res.append(idx)
        return res

        This is a helper function to sample expriences with probabilities 
        proportional to their priorities.
        Returns a list of indices.
        
surreal/replay/prioritized_replay.py