an class="bp">self</span><span class="o">.</span><span class="n">_copy_cleanup</span><span class="p">(</span><span class="o">**</span><span class="n">new_kwargs</span><span class="p">)</span>

    <span class="c"># initialize new object:</span>
    <span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="p">(</span><span class="o">**</span><span class="n">new_kwargs</span><span class="p">)</span>

    <span class=