code: def test_drawdown_overlaps(self):
      rand = np.random.RandomState(1337)
      n_samples = 252 * 5
      spy_returns = pd.Series(
          rand.standard_t(3.1, n_samples),
          pd.date_range("2005-01-02", periods=n_samples),
      )
      spy_drawdowns = timeseries.gen_drawdown_table(
          spy_returns, top=20
      ).sort_values(by="Peak date")
      # Compare the recovery date of each drawdown with the peak of the next
      # Last pair might contain a NaT if drawdown didn't finish, so ignore it
      pairs = list(
          zip(
              spy_drawdowns["Recovery date"],
              spy_drawdowns["Peak date"].shift(-1),
          )
      )[:-1]
      self.assertGreater(len(pairs), 0)
      for recovery, peak in pairs:
          if not pd.isnull(recovery):
              self.assertLessEqual(recovery, peak)
  
imports: from __future__ import division
  import os
  from unittest import TestCase
  from nose_parameterized import parameterized
  from numpy.testing import assert_allclose, assert_almost_equal
  from pandas.util.testing import assert_series_equal
  import numpy
  import pandas
  from ..None import timeseries
  from pyfolio.utils import to_utc, to_series
  import gzip
label_desc: Use image node_id 5 for calling the TestDrawdown obj's underlying member method code with example usage: obj.test_drawdown_overlaps() without return types