code: def max_drawdown(
      close: Series, method: str = None, all: bool = False
  ) -> float:
      """Maximum Drawdown from close. Default: 'dollar'.
  
      Args:
          close (pd.Series): Series of 'close's
          method (str): Max DD calculation options: 'dollar', 'percent', 'log'.
              Default: 'dollar'
          all (bool): If True, it returns all three methods as a dict.
              Default: False
  
      >>> result = ta.max_drawdown(close, method="dollar", all=False)
      """
      close = verify_series(close)
      max_dd = drawdown(close).max()
  
      max_dd_ = {
          "dollar": max_dd.iloc[0],
          "percent": max_dd.iloc[1],
          "log": max_dd.iloc[2],
      }
      if all:
          return max_dd_
  
      if isinstance(method, str) and method in max_dd_.keys():
          return max_dd_[method]
      return max_dd_["dollar"]
  
imports: from typing import Tuple
  from numpy import log
  from numpy import nan
  from numpy import sqrt
  from pandas import Series, Timedelta
  from ._core import verify_series
  from ._time import total_time
  from ._math import linear_regression, log_geometric_mean
  from pandas_ta import RATE
  from pandas_ta.performance import drawdown, log_return, percent_return
label_desc: Use image node_id 6 for calling a global function with example usage: max_drawdown(close, method, all) and returns: max_dd_, max_dd_, max_dd_