">==</span><span class="kc">True</span><span class="p">:</span>
        <span class="k">return</span> <span class="n">hierarchy</span><span class="o">.</span><span class="n">leaves_list</span><span class="p">(</span><span class="n">hierarchy</span><span class="o">.</span><span class="n">optimal_leaf_ordering</span><span class="p">(</span><span class="n">link_mat</span><span class="p">,</span> <span class="n">dist_mat</span><span class="p">))</span>
    <span class="k">else</span><span class="p">:</span>
   