"s2">&quot;normalize&quot;</span> <span class="ow">and</span> <span class="nb">sum</span><span class="p">(</span><span class="n">probabilities</span><span class="p">)</span> <span class="o">!=</span> <span class="mf">1.0</span><span class="p">:</span>
            <span class="n">probabilities</span> <span class="o">=</span> <span class="p">[</span><span class="n">prob</span> <span class="o">/</span> <span class="nb">sum</span><span class="p">(</span><span class="n">probabilities</span><span class="p">)</spa