code: def decay(
      close, kind=None, length=None, mode=None, offset=None, **kwargs
  ):
      """Indicator: Decay"""
      # Validate Arguments
      length = int(length) if length and length > 0 else 5
      mode = mode.lower() if isinstance(mode, str) else "linear"
      close = verify_series(close, length)
      offset = get_offset(offset)
  
      if close is None:
          return
  
      # Calculate Result
      _mode = "L"
      if mode == "exp" or kind == "exponential":
          _mode = "EXP"
          diff = close.shift(1) - npExp(-length)
      else:  # "linear"
          diff = close.shift(1) - (1 / length)
      diff[0] = close[0]
      tdf = DataFrame({"close": close, "diff": diff, "0": 0})
      ld = tdf.max(axis=1)
  
      # Offset
      if offset != 0:
          ld = ld.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          ld.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          ld.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name and Categorize it
      ld.name = f"{_mode}DECAY_{length}"
      ld.category = "trend"
  
      return ld
  
label_desc: Use image node_id 1 for calling a global function with example usage: decay(close, kind, length, mode, offset) and returns: ld