">c</span> <span class="o">=</span> <span class="n">chain</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">c</span> <span class="o">=</span> <span class="kc">None</span>

        <span class="c1"># create selector for chain</span>
        <span class="k">if</span> <span class="n">c</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="n">chain_sel</span> <span class="o">=</span