code: def get_max_drawdown(returns):
      
  
      returns = returns.copy()
      df_cum = cum_returns(returns, 1.0)
      running_max = np.maximum.accumulate(df_cum)
      underwater = df_cum / running_max - 1
      return get_max_drawdown_underwater(underwater)
docs: Determines the maximum drawdown of a strategy.
  
      Parameters
      ----------
      returns : pd.Series
          Daily returns of the strategy, noncumulative.
          - See full explanation in :func:`~pyfolio.timeseries.cum_returns`.
  
      Returns
      -------
      float
          Maximum drawdown.
  
      Note
      -----
      See https://en.wikipedia.org/wiki/Drawdown_(economics) for more details.