It might worth to use `sample_without_replacement` from `utils.random`.