n">keys</span><span class="p">())</span>
    <span class="n">rng</span><span class="o">.</span><span class="n">shuffle</span><span class="p">(</span><span class="n">group_ids</span><span class="p">)</span>

    <span class="c1"># Flatten the shuffled groups</span>
    <span class="n">file_list</span> <span class="o">=</span> <span class="p">[]</span>
    <span class="k">for</span> <span class="n">group_id</span> <span class="ow">in</span> <span class="n">group_ids</span><span class="p">:</span>
        <spa