code: def cci(
      df,
      periods=14,
      high="high",
      low="low",
      close="close",
      include=True,
      str="{name}({period})",
      **kwargs,
  ):
      def _cci(
          df, periods, high, low, close, include, str, detail=False
      ):
          study = "CCI"
          _df = pd.DataFrame()
          ## === talib ====
          # _df['CCI']=pd.Series(talib.CCI(df[high].values,
          # 							   df[low].values,
          # 							   df[close].values,
          # 							   periods),index=df.index)
          ## === /talib ====
  
          ## === pure python ====
          _df["tp"] = df[[low, high, close]].mean(axis=1)
          _df["avgTp"] = _df["tp"].rolling(window=periods).mean()
          mad = lambda x: np.fabs(x - x.mean()).mean()
          _df["mad"] = _df["tp"].rolling(window=periods).apply(mad)
          _df["CCI"] = (_df["tp"] - _df["avgTp"]) / (0.015 * _df["mad"])
          ## === /pure python ====
  
          return rename(
              df, _df, study, periods, "", include, str, detail
          )
  
      periods = make_list(periods)
      __df = pd.concat(
          [
              _cci(
                  df,
                  periods=y,
                  high=high,
                  low=low,
                  close=close,
                  include=False,
                  str=str,
              )
              for y in periods
          ],
          axis=1,
      )
      if include:
          return pd.concat([df, __df], axis=1)
      else:
          return __df
  
imports: import pandas
  import numpy
  from plotly.graph_objs import Figure
  from .utils import make_list
label_desc: Use image node_id 12 for calling a global function with example usage: cci(df, periods, high, low, close, include, str) and returns: rename, pd, __df