code: def stc(
      close,
      tclength=None,
      fast=None,
      slow=None,
      factor=None,
      offset=None,
      **kwargs,
  ):
      """Indicator: Schaff Trend Cycle (STC)"""
      # Validate arguments
      tclength = int(tclength) if tclength and tclength > 0 else 10
      fast = int(fast) if fast and fast > 0 else 12
      slow = int(slow) if slow and slow > 0 else 26
      factor = float(factor) if factor and factor > 0 else 0.5
      if slow < fast:  # mandatory condition, but might be confusing
          fast, slow = slow, fast
      _length = max(tclength, fast, slow)
      close = verify_series(close, _length)
      offset = get_offset(offset)
  
      if close is None:
          return
  
      # kwargs allows for three more series (ma1, ma2 and osc) which can be passed
      # here ma1 and ma2 input negate internal ema calculations, osc substitutes
      # both ma's.
      ma1 = kwargs.pop("ma1", False)
      ma2 = kwargs.pop("ma2", False)
      osc = kwargs.pop("osc", False)
  
      # 3 different modes of calculation..
      if (
          isinstance(ma1, Series)
          and isinstance(ma2, Series)
          and not osc
      ):
          ma1 = verify_series(ma1, _length)
          ma2 = verify_series(ma2, _length)
  
          if ma1 is None or ma2 is None:
              return
          # Calculate Result based on external feeded series
          xmacd = ma1 - ma2
          # invoke shared calculation
          pff, pf = schaff_tc(close, xmacd, tclength, factor)
  
      elif isinstance(osc, Series):
          osc = verify_series(osc, _length)
          if osc is None:
              return
          # Calculate Result based on feeded oscillator
          # (should be ranging around 0 x-axis)
          xmacd = osc
          # invoke shared calculation
          pff, pf = schaff_tc(close, xmacd, tclength, factor)
  
      else:
          # Calculate Result .. (traditionel/full)
          # MACD line
          fastma = ema(close, length=fast)
          slowma = ema(close, length=slow)
          xmacd = fastma - slowma
          # invoke shared calculation
          pff, pf = schaff_tc(close, xmacd, tclength, factor)
  
      # Resulting Series
      stc = Series(pff, index=close.index)
      macd = Series(xmacd, index=close.index)
      stoch = Series(pf, index=close.index)
  
      # Offset
      if offset != 0:
          stc = stc.shift(offset)
          macd = macd.shift(offset)
          stoch = stoch.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          stc.fillna(kwargs["fillna"], inplace=True)
          macd.fillna(kwargs["fillna"], inplace=True)
          stoch.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          stc.fillna(method=kwargs["fill_method"], inplace=True)
          macd.fillna(method=kwargs["fill_method"], inplace=True)
          stoch.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name and Categorize it
      _props = f"_{tclength}_{fast}_{slow}_{factor}"
      stc.name = f"STC{_props}"
      macd.name = f"STCmacd{_props}"
      stoch.name = f"STCstoch{_props}"
      stc.category = macd.category = stoch.category = "momentum"
  
      # Prepare DataFrame to return
      data = {stc.name: stc, macd.name: macd, stoch.name: stoch}
      df = DataFrame(data)
      df.name = f"STC{_props}"
      df.category = stc.category
  
      return df
  
imports: from pandas import DataFrame, Series
  from pandas_ta.overlap import ema
  from pandas_ta.utils import get_offset, non_zero_range, verify_series
label_desc: Use image node_id 1 for calling a global function with example usage: stc(close, tclength, fast, slow, factor, offset) and returns: df