code: def test_get_max_drawdown(
      self, px, expected_peak, expected_valley, expected_recovery
  ):
      rets = px.pct_change().iloc[1:]
  
      peak, valley, recovery = timeseries.get_max_drawdown(rets)
      # Need to use isnull because the result can be NaN, NaT, etc.
      self.assertTrue(
          pd.isnull(peak)
      ) if expected_peak is None else self.assertEqual(
          peak, expected_peak
      )
      self.assertTrue(
          pd.isnull(valley)
      ) if expected_valley is None else self.assertEqual(
          valley, expected_valley
      )
      self.assertTrue(
          pd.isnull(recovery)
      ) if expected_recovery is None else self.assertEqual(
          recovery, expected_recovery
      )
  
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 3 for calling the TestDrawdown obj's underlying member method code with example usage: obj.test_get_max_drawdown(px, expected_peak, expected_valley, expected_recovery) without return types