code: def dpo(close, length=None, centered=True, offset=None, **kwargs):
      """Indicator: Detrend Price Oscillator (DPO)"""
      # Validate Arguments
      length = int(length) if length and length > 0 else 20
      close = verify_series(close, length)
      offset = get_offset(offset)
      if not kwargs.get("lookahead", True):
          centered = False
  
      if close is None:
          return
  
      # Calculate Result
      t = int(0.5 * length) + 1
      ma = sma(close, length)
  
      dpo = close - ma.shift(t)
      if centered:
          dpo = (close.shift(t) - ma).shift(-t)
  
      # Offset
      if offset != 0:
          dpo = dpo.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          dpo.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          dpo.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name and Categorize it
      dpo.name = f"DPO_{length}"
      dpo.category = "trend"
  
      return dpo
  
label_desc: Use image node_id 1 for calling a global function with example usage: dpo(close, length, centered, offset) and returns: dpo