code: def save_model(
      model,
      model_name: str,
      model_only: bool = False,
      verbose: bool = True,
      **kwargs,
  ):
      """
      This function saves the transformation pipeline and trained model object
      into the current working directory as a pickle file for later use.
  
      Example
      -------
      >>> from pycaret.datasets import get_data
      >>> boston = get_data('boston')
      >>> from pycaret.regression import *
      >>> exp_name = setup(data = boston,  target = 'medv')
      >>> lr = create_model('lr')
      >>> save_model(lr, 'saved_lr_model')
  
  
      model: scikit-learn compatible object
          Trained model object
  
  
      model_name: str
          Name of the model.
  
  
      model_only: bool, default = False
          When set to True, only trained model object is saved instead of the
          entire pipeline.
  
  
      **kwargs:
          Additional keyword arguments to pass to joblib.dump().
  
  
      verbose: bool, default = True
          Success message is not printed when verbose is set to False.
  
  
      Returns:
          Tuple of the model object and the filename.
  
      """
  
      return _CURRENT_EXPERIMENT.save_model(
          model=model,
          model_name=model_name,
          model_only=model_only,
          verbose=verbose,
          **kwargs,
      )
  
imports: import logging
  import os
  from typing import Any, BinaryIO, Callable, Dict, List, Optional, Union
  import pandas
  from joblib.memory import Memory
  from pycaret.internal.parallel.parallel_backend import ParallelBackend
  from pycaret.loggers.base_logger import BaseLogger
  from pycaret.regression.oop import RegressionExperiment
  from pycaret.utils.constants import DATAFRAME_LIKE, SEQUENCE_LIKE, TARGET_LIKE
  from pycaret.utils.generic import check_if_global_is_not_none
label_desc: Use image node_id 16 for calling a global function with example usage: save_model(model, model_name, model_only, verbose) and returns: _CURRENT_EXPERIMENT