code: def kc(
      high,
      low,
      close,
      length=None,
      scalar=None,
      mamode=None,
      offset=None,
      **kwargs,
  ):
      """Indicator: Keltner Channels (KC)"""
      # Validate arguments
      length = int(length) if length and length > 0 else 20
      scalar = float(scalar) if scalar and scalar > 0 else 2
      mamode = mamode if isinstance(mamode, str) else "ema"
      high = verify_series(high, length)
      low = verify_series(low, length)
      close = verify_series(close, length)
      offset = get_offset(offset)
  
      if high is None or low is None or close is None:
          return
  
      # Calculate Result
      use_tr = kwargs.pop("tr", True)
      if use_tr:
          range_ = true_range(high, low, close)
      else:
          range_ = high_low_range(high, low)
  
      basis = ma(mamode, close, length=length)
      band = ma(mamode, range_, length=length)
  
      lower = basis - scalar * band
      upper = basis + scalar * band
  
      # Offset
      if offset != 0:
          lower = lower.shift(offset)
          basis = basis.shift(offset)
          upper = upper.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          lower.fillna(kwargs["fillna"], inplace=True)
          basis.fillna(kwargs["fillna"], inplace=True)
          upper.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          lower.fillna(method=kwargs["fill_method"], inplace=True)
          basis.fillna(method=kwargs["fill_method"], inplace=True)
          upper.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name and Categorize it
      _props = f"{mamode.lower()[0] if len(mamode) else ''}_{length}_{scalar}"
      lower.name = f"KCL{_props}"
      basis.name = f"KCB{_props}"
      upper.name = f"KCU{_props}"
      basis.category = upper.category = lower.category = "volatility"
  
      # Prepare DataFrame to return
      data = {lower.name: lower, basis.name: basis, upper.name: upper}
      kcdf = DataFrame(data)
      kcdf.name = f"KC{_props}"
      kcdf.category = basis.category
  
      return kcdf
  
imports: from pandas import DataFrame
  from .true_range import true_range
  from pandas_ta.overlap import ma
  from pandas_ta.utils import get_offset, high_low_range, verify_series
label_desc: Use image node_id 1 for calling a global function with example usage: kc(high, low, close, length, scalar, mamode, offset) and returns: kcdf