code: def get_top_drawdowns(returns, top=10):
      """
      Finds top drawdowns, sorted by drawdown amount.
  
      Parameters
      ----------
      returns : pd.Series
          Daily returns of the strategy, noncumulative.
           - See full explanation in tears.create_full_tear_sheet.
      top : int, optional
          The amount of top drawdowns to find (default 10).
  
      Returns
      -------
      drawdowns : list
          List of drawdown peaks, valleys, and recoveries. See get_max_drawdown.
      """
  
      returns = returns.copy()
      df_cum = ep.cum_returns(returns, 1.0)
      running_max = np.maximum.accumulate(df_cum)
      underwater = df_cum / running_max - 1
  
      drawdowns = []
      for _ in range(top):
          peak, valley, recovery = get_max_drawdown_underwater(
              underwater
          )
          # Slice out draw-down period
          if not pd.isnull(recovery):
              underwater.drop(
                  underwater[peak:recovery].index[1:-1], inplace=True
              )
          else:
              # drawdown has not ended yet
              underwater = underwater.loc[:peak]
  
          drawdowns.append((peak, valley, recovery))
          if (
              (len(returns) == 0)
              or (len(underwater) == 0)
              or (np.min(underwater) == 0)
          ):
              break
  
      return drawdowns
  
imports: from __future__ import division
  from collections import OrderedDict
  from functools import partial
  import empyrical
  import numpy
  import pandas
  import scipy
  import scipy.stats
  from sklearn import linear_model
  from .deprecate import deprecated
  from .interesting_periods import PERIODS
  from .txn import get_turnover
  from .utils import APPROX_BDAYS_PER_MONTH, APPROX_BDAYS_PER_YEAR
  from .utils import DAILY
label_desc: Use image node_id 29 for calling a global function with example usage: get_top_drawdowns(returns, top) and returns: drawdowns