olumn</span><span class="p">]</span>
        <span class="k">elif</span> <span class="n">chain</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="c1"># if we have a dictionary and a segment column,</span>
            <span class="c1"># use that</span>
            <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">chain</span><span class="p">,</span> <span class="nb">dict<