code: def _save_learner_to_disk(
      learner: Union[
          "skll.learner.Learner", "skll.learner.voting.VotingLearner"
      ],
      filepath: PathOrStr,
  ) -> None:
      """
      Save the given SKLL learner instance to disk.
  
      NOTE: This function should only be used by the ``save()`` methods
      for the various learner classes in SKLL.
  
      Parameters
      ----------
      learner : Union[:class:`skll.learner.Learner`, :class:`skll.learner.voting.VotingLearner`]
          A ``Learner`` or ``VotingLearner`` instance to save to disk.
      filepath : :class:`skll.types.PathOrStr`
          The path to save the learner instance to.
      """
      # create the directory if it doesn't exist
      learner_dir = Path(filepath).parent
      if not learner_dir.exists():
          learner_dir.mkdir(parents=True)
      # write out the learner to disk
      joblib.dump((VERSION, learner), filepath)
  
imports: from __future__ import annotations
  import inspect
  import logging
  import sys
  import time
  from collections import Counter, defaultdict
  from csv import DictWriter, excel_tab
  from functools import wraps
  from importlib import import_module
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
  import joblib
  import numpy
  import scipy.sparse
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.feature_selection import SelectKBest
  from sklearn.metrics import accuracy_score, confusion_matrix, precision_recall_fscore_support
  from sklearn.model_selection import KFold, LeaveOneGroupOut, ShuffleSplit, StratifiedKFold
  from skll.data import FeatureSet
  from skll.metrics import _CUSTOM_METRICS, _PREDEFINED_CUSTOM_METRICS, use_score_func
  from skll.types import ComputeEvalMetricsResults, ConfusionMatrix, FeaturesetIterator, FoldMapping, IdType, IndexIterator, LabelType, PathOrStr, SparseFeatureMatrix
  from skll.utils.constants import CLASSIFICATION_ONLY_METRICS, CORRELATION_METRICS, REGRESSION_ONLY_METRICS, UNWEIGHTED_KAPPA_METRICS, WEIGHTED_KAPPA_METRICS
  from skll.version import VERSION
label_desc: Use image node_id 14 for calling a global function with example usage: _save_learner_to_disk(learner, filepath) without return types