code: def stl(
      data: pd.Series,
      period: Optional[int] = None,
      seasonal: int = 7,
      trend: Optional[int] = None,
      low_pass: Optional[int] = None,
      seasonal_deg: Optional[int] = 0,
      trend_deg: Optional[int] = 0,
      low_pass_deg: Optional[int] = 0,
      robust: bool = False,
      seasonal_jump: int = 1,
      trend_jump: int = 1,
      low_pass_jump: int = 1,
  ) -> pd.DataFrame:
      """Season-Trend decomposition using LOESS.
  
      Returns:
          pd.DataFrame: DataFrame with 3 columns: trend, seasonality and residual.
  
      See Also:
          statsmodels STL:
          https://www.statsmodels.org/stable/generated/statsmodels.tsa.seasonal.STL.html
      """
      period_ = period or freq_to_period(data.index.inferred_freq)
      if period_ < 2:
          return pd.DataFrame()
      res = STL(
          data.fillna(method="bfill").fillna(method="ffill"),
          period=period,
          seasonal=seasonal,
          trend=trend,
          low_pass=low_pass,
          seasonal_deg=seasonal_deg,
          trend_deg=trend_deg,
          low_pass_deg=low_pass_deg,
          robust=robust,
          seasonal_jump=seasonal_jump,
          trend_jump=trend_jump,
          low_pass_jump=low_pass_jump,
      ).fit()
      return pd.DataFrame(
          {
              "trend": res.trend,
              "seasonality": res.seasonal,
              "residual": res.resid,
          }
      )
  
imports: from typing import Optional
  import pandas
  from statsmodels.tsa.seasonal import STL
  from statsmodels.tsa.tsatools import freq_to_period
  from tslumen.profile.base import ProfilingFunction
label_desc: Use image node_id 1 for calling a global function with example usage: stl(data, period, seasonal, trend, low_pass, seasonal_deg, trend_deg, low_pass_deg, robust, seasonal_jump, trend_jump, low_pass_jump) and returns: pd, pd