code: def finalize_model(
      estimator,
      fit_kwargs: Optional[dict] = None,
      model_only: bool = False,
  ) -> Any:
      """
      This function trains a given estimator on the entire dataset including the
      holdout set.
  
  
      Example
      --------
      >>> from pycaret.datasets import get_data
      >>> data = get_data('airline')
      >>> from pycaret.time_series import *
      >>> exp_name = setup(data = data, fh = 12)
      >>> arima = create_model('arima')
      >>> final_arima = finalize_model(arima)
  
  
      estimator: sktime compatible object
          Trained model object
  
  
      fit_kwargs: dict, default = None
          Dictionary of arguments passed to the fit method of the model.
  
  
      model_only: bool, default = True
          Parameter not in use for now. Behavior may change in future.
  
  
      Returns:
          Trained pipeline or model object fitted on complete dataset.
  
  
      """
  
      return _CURRENT_EXPERIMENT.finalize_model(
          estimator=estimator,
          fit_kwargs=fit_kwargs,
          model_only=model_only,
      )
  
imports: import logging
  import os
  from typing import TYPE_CHECKING, Any, BinaryIO, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from pycaret.internal.parallel.parallel_backend import ParallelBackend
  from pycaret.time_series.forecasting.oop import TSForecastingExperiment
  from pycaret.utils.generic import check_if_global_is_not_none
label_desc: Use image node_id 10 for calling a global function with example usage: finalize_model(estimator, fit_kwargs, model_only) and returns: _CURRENT_EXPERIMENT