pan><span class="n">append</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>

    <span class="c1"># Shuffle the group_ids</span>
    <span class="n">rng</span> <span class="o">=</span> <span class="n">RandomState</span><span class="p">(</span><span class="n">seed</span><span class="p">)</span>
    <span class="n">group_ids</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">file_groups</span><span class="o">.</span><span class="