def randomly_sample_subset(dataset, size=500):
    """Randomly sample subset from a dataset"""
    random_indices = [random.randint(0, len(dataset) - 1) for i in range(size)]
    return [dataset[i] for i in random_indices]
Randomly sample subset from a dataset
examples/speech_to_speech/benchmarking/data_utils.py