code: def prophet(  # pylint: disable=too-many-arguments
      df: DataFrame,
      time_grain: str,
      periods: int,
      confidence_interval: float,
      yearly_seasonality: Optional[Union[bool, int]] = None,
      weekly_seasonality: Optional[Union[bool, int]] = None,
      daily_seasonality: Optional[Union[bool, int]] = None,
      index: Optional[str] = None,
  ) -> DataFrame:
      """
      Add forecasts to each series in a timeseries dataframe, along with confidence
      intervals for the prediction. For each series, the operation creates three
      new columns with the column name suffixed with the following values:
  
      - `__yhat`: the forecast for the given date
      - `__yhat_lower`: the lower bound of the forecast for the given date
      - `__yhat_upper`: the upper bound of the forecast for the given date
  
  
      :param df: DataFrame containing all-numeric data (temporal column ignored)
      :param time_grain: Time grain used to specify time period increments in prediction
      :param periods: Time periods (in units of `time_grain`) to predict into the future
      :param confidence_interval: Width of predicted confidence interval
      :param yearly_seasonality: Should yearly seasonality be applied.
             An integer value will specify Fourier order of seasonality.
      :param weekly_seasonality: Should weekly seasonality be applied.
             An integer value will specify Fourier order of seasonality, `None` will
             automatically detect seasonality.
      :param daily_seasonality: Should daily seasonality be applied.
             An integer value will specify Fourier order of seasonality, `None` will
             automatically detect seasonality.
      :param index: the name of the column containing the x-axis data
      :return: DataFrame with contributions, with temporal column at beginning if present
      """
      index = index or DTTM_ALIAS
      # validate inputs
      if not time_grain:
          raise InvalidPostProcessingError(_("Time grain missing"))
      if time_grain not in PROPHET_TIME_GRAIN_MAP:
          raise InvalidPostProcessingError(
              _(
                  "Unsupported time grain: %(time_grain)s",
                  time_grain=time_grain,
              )
          )
      freq = PROPHET_TIME_GRAIN_MAP[time_grain]
      # check type at runtime due to marshmallow schema not being able to handle
      # union types
      if not isinstance(periods, int) or periods < 0:
          raise InvalidPostProcessingError(
              _("Periods must be a whole number")
          )
      if (
          not confidence_interval
          or confidence_interval <= 0
          or confidence_interval >= 1
      ):
          raise InvalidPostProcessingError(
              _(
                  "Confidence interval must be between 0 and 1 (exclusive)"
              )
          )
      if index not in df.columns:
          raise InvalidPostProcessingError(
              _("DataFrame must include temporal column")
          )
      if len(df.columns) < 2:
          raise InvalidPostProcessingError(
              _("DataFrame include at least one series")
          )
  
      target_df = DataFrame()
  
      for column in [
          column
          for column in df.columns
          if column != index
          and pd.to_numeric(df[column], errors="coerce").notnull().all()
      ]:
          fit_df = _prophet_fit_and_predict(
              df=df[[index, column]].rename(
                  columns={index: "ds", column: "y"}
              ),
              confidence_interval=confidence_interval,
              yearly_seasonality=_prophet_parse_seasonality(
                  yearly_seasonality
              ),
              weekly_seasonality=_prophet_parse_seasonality(
                  weekly_seasonality
              ),
              daily_seasonality=_prophet_parse_seasonality(
                  daily_seasonality
              ),
              periods=periods,
              freq=freq,
          )
          new_columns = [
              f"{column}__yhat",
              f"{column}__yhat_lower",
              f"{column}__yhat_upper",
              f"{column}",
          ]
          fit_df.columns = new_columns
          if target_df.empty:
              target_df = fit_df
          else:
              for new_column in new_columns:
                  target_df = target_df.assign(
                      **{new_column: fit_df[new_column]}
                  )
      target_df.reset_index(level=0, inplace=True)
      return target_df.rename(columns={"ds": index})
  
file_path: superset/superset/utils/pandas_postprocessing/prophet.py
imports: import logging
  from typing import Optional, Union
  import pandas
  from flask_babel import gettext
  from pandas import DataFrame
  from superset.exceptions import InvalidPostProcessingError
  from superset.utils.core import DTTM_ALIAS
  from superset.utils.pandas_postprocessing.utils import PROPHET_TIME_GRAIN_MAP
label_desc: Use image node_id 3 for calling a global function with example usage: prophet(df, time_grain, periods, confidence_interval, yearly_seasonality, weekly_seasonality, daily_seasonality, index) and returns: target_df