class_docstr: Base template with common code used by multiple templates.
  
  Provides a particular modular approach to implement
  `~greykite.framework.templates.template_interface.TemplateInterface.apply_template_for_pipeline_params`.
  
  Includes the config defaults from
  `~greykite.framework.templates.forecast_config_defaults.ForecastConfigDefaults`.
  
  Subclasses must provide these properties / functions used by ``apply_template_for_pipeline_params``:
  
      - estimator (__init__ default value)
      - get_regressor_cols
      - get_lagged_regressor_info
      - get_hyperparameter_grid
  
  Subclasses may optionally want to override:
  
      - get_pipeline
      - get_forecast_time_properties
      - apply_metadata_defaults
      - apply_evaluation_metric_defaults
      - apply_evaluation_period_defaults
      - apply_computation_defaults
      - apply_model_components_defaults
      - apply_forecast_config_defaults
class_docstr_tok: ["Base","template","with","common","code","used","by","multiple","templates",".","Provides","a","particular","modular","approach","to","implement","`","~greykite.framework.templates.template_interface.TemplateInterface.apply_template_for_pipeline_params","`",".","Includes","the","config","defaults","from","`","~greykite.framework.templates.forecast_config_defaults.ForecastConfigDefaults","`",".","Subclasses","must","provide","these","properties","\/","functions","used","by","``","apply_template_for_pipeline_params","``",":","-","estimator","(","__init__","default","value",")","-","get_regressor_cols","-","get_lagged_regressor_info","-","get_hyperparameter_grid","Subclasses","may","optionally","want","to","override",":","-","get_pipeline","-","get_forecast_time_properties","-","apply_metadata_defaults","-","apply_evaluation_metric_defaults","-","apply_evaluation_period_defaults","-","apply_computation_defaults","-","apply_model_components_defaults","-","apply_forecast_config_defaults"]
docstr: Decorator for ``apply_template_for_pipeline_params`` function.
  
  By default, this applies ``apply_forecast_config_defaults`` to ``config``.
  
  Subclass may override this for pre/post processing of
  ``apply_template_for_pipeline_params``, such as input validation.
  In this case, ``apply_template_for_pipeline_params`` must also be implemented in the subclass.
docstr_tok: ["Decorator","for","``","apply_template_for_pipeline_params","``","function",".","By","default",",","this","applies","``","apply_forecast_config_defaults","``","to","``","config","``",".","Subclass","may","override","this","for","pre\/post","processing","of","``","apply_template_for_pipeline_params","``",",","such","as","input","validation",".","In","this","case",",","``","apply_template_for_pipeline_params","``","must","also","be","implemented","in","the","subclass","."]
code: def apply_template_decorator(func):
      """Decorator for ``apply_template_for_pipeline_params`` function.
  
      By default, this applies ``apply_forecast_config_defaults`` to ``config``.
  
      Subclass may override this for pre/post processing of
      ``apply_template_for_pipeline_params``, such as input validation.
      In this case, ``apply_template_for_pipeline_params`` must also be implemented in the subclass.
      """
  
      @functools.wraps(func)
      def process_wrapper(
          self,
          df: pd.DataFrame,
          config: Optional[ForecastConfig] = None,
      ):
          # Sets defaults and makes a copy of ``config``
          # All subclasses should keep this line.
          config = self.apply_forecast_config_defaults(config)
          # <optional processing before calling `func`, if needed>
          pipeline_params = func(self, df, config)
          # <optional postprocessing after calling `func`, if needed>
          return pipeline_params
  
      return process_wrapper
  
imports: import functools
  from abc import ABC
  from abc import abstractmethod
  from typing import Dict
  from typing import Optional
  import pandas
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.time_properties_forecast import get_forecast_time_properties
  from greykite.framework.pipeline.utils import get_basic_pipeline
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.forecast_config_defaults import ForecastConfigDefaults
  from greykite.framework.templates.template_interface import TemplateInterface
  from greykite.sklearn.estimator.base_forecast_estimator import BaseForecastEstimator
label_desc: Use image node_id 8 for calling the BaseTemplate obj's underlying member method code with example usage: obj.apply_template_decorator(func) and returns: process_wrapper, pipeline_params