an> <span class="kc">None</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Either directory or cdb is required!&#39;</span><span class="p">)</span>
        
        <span class="c1"># Determine the filename for writing</span>
        <span class="k">if</span> <span class="n">cdb</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <s