code: def save_detector(
      detector: Union[Detector, ConfigurableDetector],
      filepath: Union[str, os.PathLike],
      legacy: bool = False,
  ) -> None:
      """
      Save outlier, drift or adversarial detector.
  
      Parameters
      ----------
      detector
          Detector object.
      filepath
          Save directory.
      legacy
          Whether to save in the legacy .dill format instead of via a config.toml file. Default is `False`.
      """
      warnings.warn(
          "This function has been moved to alibi_detect.saving.save_detector()."
          "This legacy link will be removed in a future version",
          DeprecationWarning,
      )
      return _save_detector(detector, filepath, legacy)
  
imports: from alibi_detect.saving import load_detector, save_detector
  from alibi_detect.base import ConfigurableDetector, Detector
  from typing import Union
  import warnings
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: save_detector(detector, filepath, legacy) and returns: _save_detector