code: def drawdown(close, offset=None, **kwargs) -> DataFrame:
      """Indicator: Drawdown (DD)"""
      # Validate Arguments
      close = verify_series(close)
      offset = get_offset(offset)
  
      # Calculate Result
      max_close = close.cummax()
      dd = max_close - close
      dd_pct = 1 - (close / max_close)
  
      _np_err = seterr()
      seterr(divide="ignore", invalid="ignore")
      dd_log = nplog(max_close) - nplog(close)
      seterr(divide=_np_err["divide"], invalid=_np_err["invalid"])
  
      # Offset
      if offset != 0:
          dd = dd.shift(offset)
          dd_pct = dd_pct.shift(offset)
          dd_log = dd_log.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          dd.fillna(kwargs["fillna"], inplace=True)
          dd_pct.fillna(kwargs["fillna"], inplace=True)
          dd_log.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          dd.fillna(method=kwargs["fill_method"], inplace=True)
          dd_pct.fillna(method=kwargs["fill_method"], inplace=True)
          dd_log.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name and Categorize it
      dd.name = "DD"
      dd_pct.name = f"{dd.name}_PCT"
      dd_log.name = f"{dd.name}_LOG"
      dd.category = dd_pct.category = dd_log.category = "performance"
  
      # Prepare DataFrame to return
      data = {dd.name: dd, dd_pct.name: dd_pct, dd_log.name: dd_log}
      df = DataFrame(data)
      df.name = dd.name
      df.category = dd.category
  
      return df
  
imports: from numpy import log
  from numpy import seterr
  from pandas import DataFrame
  from pandas_ta.utils import get_offset, verify_series
label_desc: Use image node_id 1 for calling a global function with example usage: drawdown(close, offset) and returns: df