code: def kama(
      close,
      length=None,
      fast=None,
      slow=None,
      drift=None,
      offset=None,
      **kwargs,
  ):
      """Indicator: Kaufman's Adaptive Moving Average (KAMA)"""
      # Validate Arguments
      length = int(length) if length and length > 0 else 10
      fast = int(fast) if fast and fast > 0 else 2
      slow = int(slow) if slow and slow > 0 else 30
      close = verify_series(close, max(fast, slow, length))
      drift = get_drift(drift)
      offset = get_offset(offset)
  
      if close is None:
          return
  
      # Calculate Result
      def weight(length: int) -> float:
          return 2 / (length + 1)
  
      fr = weight(fast)
      sr = weight(slow)
  
      abs_diff = non_zero_range(close, close.shift(length)).abs()
      peer_diff = non_zero_range(close, close.shift(drift)).abs()
      peer_diff_sum = peer_diff.rolling(length).sum()
      er = abs_diff / peer_diff_sum
      x = er * (fr - sr) + sr
      sc = x * x
  
      m = close.size
      result = [npNaN for _ in range(0, length - 1)] + [0]
      for i in range(length, m):
          result.append(
              sc.iloc[i] * close.iloc[i]
              + (1 - sc.iloc[i]) * result[i - 1]
          )
  
      kama = Series(result, index=close.index)
  
      # Offset
      if offset != 0:
          kama = kama.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          kama.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          kama.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name & Category
      kama.name = f"KAMA_{length}_{fast}_{slow}"
      kama.category = "overlap"
  
      return kama
  
label_desc: Use image node_id 1 for calling a global function with example usage: kama(close, length, fast, slow, drift, offset) and returns: kama, unknown