code: def dm(
      high,
      low,
      length=None,
      mamode=None,
      talib=None,
      drift=None,
      offset=None,
      **kwargs,
  ):
      """Indicator: DM"""
      # Validate Arguments
      length = int(length) if length and length > 0 else 14
      mamode = (
          mamode.lower()
          if mamode and isinstance(mamode, str)
          else "rma"
      )
      high = verify_series(high)
      low = verify_series(low)
      drift = get_drift(drift)
      offset = get_offset(offset)
      mode_tal = bool(talib) if isinstance(talib, bool) else True
  
      if high is None or low is None:
          return
  
      if Imports["talib"] and mode_tal:
          from talib import MINUS_DM, PLUS_DM
  
          pos = PLUS_DM(high, low, length)
          neg = MINUS_DM(high, low, length)
      else:
          up = high - high.shift(drift)
          dn = low.shift(drift) - low
  
          pos_ = ((up > dn) & (up > 0)) * up
          neg_ = ((dn > up) & (dn > 0)) * dn
  
          pos_ = pos_.apply(zero)
          neg_ = neg_.apply(zero)
  
          # Not the same values as TA Lib's -+DM (Good First Issue)
          pos = ma(mamode, pos_, length=length)
          neg = ma(mamode, neg_, length=length)
  
      # Offset
      if offset != 0:
          pos = pos.shift(offset)
          neg = neg.shift(offset)
  
      _params = f"_{length}"
      data = {
          f"DMP{_params}": pos,
          f"DMN{_params}": neg,
      }
  
      dmdf = DataFrame(data)
      # print(dmdf.head(20))
      # print()
      dmdf.name = f"DM{_params}"
      dmdf.category = "trend"
  
      return dmdf
  
imports: from pandas import DataFrame
  from pandas_ta import Imports
  from pandas_ta.overlap import ma
  from pandas_ta.utils import get_offset, verify_series, get_drift, zero
label_desc: Use image node_id 1 for calling a global function with example usage: dm(high, low, length, mamode, talib, drift, offset) and returns: dmdf