code: def max_drawdown(returns, out=None):
      """
      Determines the maximum drawdown of a strategy.
  
      Parameters
      ----------
      returns : pd.Series or np.ndarray
          Daily returns of the strategy, noncumulative.
          - See full explanation in :func:`~empyrical.stats.cum_returns`.
      out : array-like, optional
          Array to use as output buffer.
          If not passed, a new array will be created.
  
      Returns
      -------
      max_drawdown : float
  
      Note
      -----
      See https://en.wikipedia.org/wiki/Drawdown_(economics) for more details.
      """
      allocated_output = out is None
      if allocated_output:
          out = np.empty(returns.shape[1:])
  
      returns_1d = returns.ndim == 1
  
      if len(returns) < 1:
          out[()] = np.nan
          if returns_1d:
              out = out.item()
          return out
  
      returns_array = np.asanyarray(returns)
  
      cumulative = np.empty(
          (returns.shape[0] + 1,) + returns.shape[1:],
          dtype="float64",
      )
      cumulative[0] = start = 100
      cum_returns(
          returns_array, starting_value=start, out=cumulative[1:]
      )
  
      max_return = np.fmax.accumulate(cumulative, axis=0)
  
      nanmin((cumulative - max_return) / max_return, axis=0, out=out)
      if returns_1d:
          out = out.item()
      elif allocated_output and isinstance(returns, pd.DataFrame):
          out = pd.Series(out)
  
      return out
  
imports: from __future__ import division
  import math
  import pandas
  import numpy
  from math import pow
  from scipy import stats, optimize
  from six import iteritems
  from sys import float_info
  from .utils import nanmean, nanstd, nanmin, up, down, roll, rolling_window
  from .periods import ANNUALIZATION_FACTORS, APPROX_BDAYS_PER_YEAR
  from .periods import DAILY, WEEKLY, MONTHLY, QUARTERLY, YEARLY
label_desc: Use image node_id 10 for calling a global function with example usage: max_drawdown(returns, out) and returns: out, out