hreshold_pre</span><span class="p">(</span><span class="n">threshold</span><span class="p">)</span>
        <span class="n">threshold</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">restrict_clamp_threshold</span><span class="p">(</span><span class="n">threshold</span><span class="p">)</span>
        <span class="c1"># Clamping avoids eventual log(0) with restrict_val</span>
        <span class="n">stats</span> <span class="o">=</span> <span class="bp">sel