 class="k">else</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s1">&#39;masking mode must either be &quot;binary&quot; or &quot;relative&quot;!&#39;</span><span class="p">)</span>

        <span class="n">spec_harm</span> <span class="o">=</span> <span class="n">mask_harm</span> <span class="o">*</span> <span class="n">spec</span>
        <span class="n">spec_perc</span> <span class="o">=</span> <span class="n">ma