code: def trima(close, length=None, talib=None, offset=None, **kwargs):
      """Indicator: Triangular Moving Average (TRIMA)"""
      # Validate Arguments
      length = int(length) if length and length > 0 else 10
      close = verify_series(close, length)
      offset = get_offset(offset)
      mode_tal = bool(talib) if isinstance(talib, bool) else True
  
      if close is None:
          return
  
      # Calculate Result
      if Imports["talib"] and mode_tal:
          from talib import TRIMA
  
          trima = TRIMA(close, length)
      else:
          half_length = round(0.5 * (length + 1))
          sma1 = sma(close, length=half_length)
          trima = sma(sma1, length=half_length)
  
      # Offset
      if offset != 0:
          trima = trima.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          trima.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          trima.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name & Category
      trima.name = f"TRIMA_{length}"
      trima.category = "overlap"
  
      return trima
  
label_desc: Use image node_id 1 for calling a global function with example usage: trima(close, length, talib, offset) and returns: trima