code: def rolling_avg(
      data: pd.Series,
      wins: Optional[Tuple[int, ...]] = tuple(),
      max_win_frac: int = 10,
  ) -> pd.DataFrame:
      """Rolling average.
  
      Args:
          data (pd.Series): Time series.
          wins (Tuple[int, ...]): Size of the rolling windows -- determined based on frequency if not
              provided.
          max_win_frac (int): Forces window size to be no bigger than ``data.length/max_win_frac``.
  
      Returns:
          pd.DataFrame: DataFrame with original series (labelled 'original') and N smoothed series,
          as dictated by the parameter ``wins``, each series labelled as `rolling <win><freq>`.
      """
      freq = data.index.inferred_freq
      freq = freq[0] if freq else ""
      if not wins:
          max_win = len(data) // max_win_frac
          wins_dic = {
              "A": (3, 4, 5),
              "Q": (2, 4, 8),
              "M": (3, 6, 12),
              "W": (4, 8, 12),
              "D": (7, 14, 30, 90),
              "B": (5, 10, 20, 60),
              "H": (12, 24, 7 * 24, 30 * 24),
          }
          wins = (
              wins_dic.get(freq, (max_win // 4, max_win // 2, max_win))
              or tuple()
          )
          wins = tuple(w for w in wins if w <= max_win)
      datac = data.fillna(method="bfill").fillna(method="ffill")
      return pd.concat(
          [data.rename("original")]
          + [
              datac.rolling(w).mean().rename(f"rolling {w}{freq}")
              for w in wins
          ],
          axis=1,
      )
  
file_path: tslumen/tslumen/profile/smooth.py
imports: from typing import Optional, Tuple
  import numpy
  import pandas
  from statsmodels.nonparametric import smoothers_lowess
  from .None import _supsmu
  from tslumen.profile.base import ProfilingFunction
label_desc: Use image node_id 2 for calling a global function with example usage: rolling_avg(data, wins, max_win_frac) and returns: pd