code: def load_custom_learner(
      custom_learner_path: Optional[PathOrStr], custom_learner_name: str
  ) -> "skll.learner.Learner":
      """
      Import and load the custom learner object from the given path.
  
      Parameters
      ----------
      custom_learner_path : :class:`skll.types.PathOrStr`
          The path to a custom learner.
      custom_learner_name : str
          The name of a custom learner.
  
      Returns
      -------
      :class:`skll.learner.Learner`
          The SKLL learner object loaded from the given path.
  
      Raises
      ------
      ValueError
          If the custom learner path does not end in '.py'.
      """
      if not custom_learner_path:
          raise ValueError(
              "custom_learner_path was not set and learner "
              f"{custom_learner_name} was not found."
          )
  
      # convert to a Path object
      custom_learner_path = Path(custom_learner_path)
  
      if custom_learner_path.suffix != ".py":
          raise ValueError(
              "custom_learner_path must end in .py "
              f"({custom_learner_path})"
          )
  
      custom_learner_module_name = custom_learner_path.stem
      sys.path.append(str(custom_learner_path.resolve().parent))
      import_module(custom_learner_module_name)
      return getattr(
          sys.modules[custom_learner_module_name], custom_learner_name
      )
  
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 7 for calling a global function with example usage: load_custom_learner(custom_learner_path, custom_learner_name) and returns: getattr