code: def rsi(
      df,
      periods=14,
      column=None,
      include=True,
      str="{name}({column},{period})",
      detail=False,
      **kwargs,
  ):
      def _rsi(df, periods, column, include, str, detail):
          study = "RSI"
          df, _df, column = validate(df, column)
          ## === talib ====
          # _df['RSI']=pd.Series(talib.RSI(df[column].values,periods),index=df.index)
          ## === /talib ====
  
          ## === pure python ====
          _df["Up"] = (
              df[column].diff().apply(lambda x: x if x > 0 else 0)
          )
          _df["Down"] = (
              df[column].diff().apply(lambda x: -x if x < 0 else 0)
          )
          _df["UpAvg"] = _df["Up"].rolling(window=periods).mean()
          _df["DownAvg"] = _df["Down"].rolling(window=periods).mean()
          _df["RSI"] = 100 - (100 / (1 + _df["UpAvg"] / _df["DownAvg"]))
          ## === /pure python ====
  
          return rename(
              df, _df, study, periods, column, include, str, detail
          )
  
      column = make_list(column)
      periods = make_list(periods)
      __df = pd.concat(
          [
              _rsi(
                  df,
                  column=x,
                  periods=y,
                  include=False,
                  str=str,
                  detail=detail,
              )
              for y in periods
              for x in column
          ],
          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 5 for calling a global function with example usage: rsi(df, periods, column, include, str, detail) and returns: rename, pd, __df