   :rtype:                         int</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">n_dim</span> <span class="o">=</span> <span class="mi">1</span>
    <span class="c1"># data_X.shape[0] is the number of time series in the dataset</span>
    <span class="k">while</span> <span class="n">n_dim</span> <span class="o">&lt;</span> <span class="n">data_X</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>