<span class="s2">&quot;luminosity_distance&quot;</span><span class="p">]</span>
    <span class="n">len_</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">t</span><span class="p">)</span>
    <span class="c1"># randomize it</span>
    <span class="k">if</span> <span class="n">randomize</span><span class="p">:</span>
        <span class="n">idx_</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span 