code: def save_model_config(
      model: BaseEstimator,
      base_path: Path,
      local_path: Path = Path("."),
  ) -> dict:
      """
      Save a scikit-learn (or xgboost) model to a config dictionary.
      Models are assumed to be a subclass of :class:`~sklearn.base.BaseEstimator`. This includes xgboost models
      following the scikit-learn API
      (see https://xgboost.readthedocs.io/en/latest/python/python_api.html#module-xgboost.sklearn).
  
      Parameters
      ----------
      model
          The model to save.
      base_path
          Base filepath to save to (the location of the `config.toml` file).
      local_path
          A local (relative) filepath to append to base_path.
  
      Returns
      -------
      The model config dict.
      """
      filepath = base_path.joinpath(local_path)
      save_model(model, filepath=filepath, save_dir="model")
      cfg_model = {
          "flavour": Framework.SKLEARN.value,
          "src": local_path.joinpath("model"),
      }
      return cfg_model
  
file_path: alibi-detect/alibi_detect/saving/_sklearn/saving.py
imports: import logging
  import os
  from pathlib import Path
  from typing import Union
  import joblib
  from sklearn.base import BaseEstimator
  from alibi_detect.utils.frameworks import Framework
label_desc: Use image node_id 1 for calling a global function with example usage: save_model_config(model, base_path, local_path) and returns: cfg_model