code: def base_callback_class_sorter(
      auxiliary_bases, parent_class_order=None
  ):
      """Sort callback classes in order to preserve the intended MRO of their descendant, and to
      enable callbacks that may depend on one another to function properly
  
      Parameters
      ----------
      auxiliary_bases: List
          The callback classes to be sorted according to the order in which their parent is found in
          `parent_class_order`. For example, if a class (x) in `auxiliary_bases` is the only
          descendant of the last class in `parent_class_order`, then class x will be moved to the last
          position in `sorted_auxiliary_bases`. If multiple classes in `auxiliary_bases` are
          descendants of the same parent in `parent_class_order`, they will be sorted alphabetically
          (from A-Z)
      parent_class_order: List, or None, default=<See description>
          List of base callback classes that define the sort order for `auxiliary_bases`. Note that
          these are not the normal callback classes that add to the functionality of an Experiment,
          but the base classes from which the callback classes are descendants. All the classes in
          `parent_class_order` should be defined in :mod:`hyperparameter_hunter.callbacks.bases`. The
          last class in `parent_class_order` should be
          :class:`hyperparameter_hunter.callbacks.bases.BaseCallback`, which is the parent class for
          all other base classes. This ensures that custom callbacks defined by
          :func:`hyperparameter_hunter.callbacks.bases.lambda_callback` will be recognized as valid
          and executed last
  
      Returns
      -------
      sorted_auxiliary_bases: List
          The contents of `auxiliary_bases` sorted according to their parents' location in
          `parent_class_order`, then alphabetically
  
      Raises
      ------
      ValueError
          If `auxiliary_bases` contains a class that is not a descendant of any of the classes in
          `parent_class_order`
  
      Examples
      --------
      >>> in_0 = [AggregatorEvaluations, AggregatorTimes, EvaluatorOOF, EvaluatorHoldout, LoggerFitStatus, PredictorOOF, PredictorHoldout, PredictorTest]
      >>> out_0 = [PredictorHoldout, PredictorOOF, PredictorTest, EvaluatorHoldout, EvaluatorOOF, AggregatorEvaluations, AggregatorTimes, LoggerFitStatus]
      >>> assert base_callback_class_sorter(in_0) == out_0
      >>> in_1 = [AggregatorEvaluations, AggregatorTimes, EvaluatorOOF, EvaluatorHoldout, LoggerFitStatus, PredictorOOF, PredictorHoldout, PredictorTest]
      >>> out_1 = [PredictorHoldout, PredictorOOF, PredictorTest, EvaluatorHoldout, EvaluatorOOF, AggregatorEvaluations, AggregatorTimes, LoggerFitStatus]
      >>> assert base_callback_class_sorter(in_1) == out_1
      >>> in_2 = [PredictorOOF, PredictorHoldout, AggregatorTimes, PredictorTest, AggregatorEvaluations, EvaluatorOOF, EvaluatorHoldout, LoggerFitStatus]
      >>> out_2 = [PredictorHoldout, PredictorOOF, PredictorTest, EvaluatorHoldout, EvaluatorOOF, AggregatorEvaluations, AggregatorTimes, LoggerFitStatus]
      >>> assert base_callback_class_sorter(in_2) == out_2
      >>> in_3 = [PredictorTest, EvaluatorHoldout, LoggerFitStatus, AggregatorTimes, PredictorHoldout, PredictorOOF, AggregatorEvaluations, EvaluatorOOF]
      >>> out_3 = [PredictorHoldout, PredictorOOF, PredictorTest, EvaluatorHoldout, EvaluatorOOF, AggregatorEvaluations, AggregatorTimes, LoggerFitStatus]
      >>> assert base_callback_class_sorter(in_3) == out_3
      >>> in_4 = [LoggerFitStatus, EvaluatorOOF, PredictorTest, EvaluatorHoldout, AggregatorTimes, AggregatorEvaluations, PredictorHoldout, PredictorOOF]
      >>> out_4 = [PredictorHoldout, PredictorOOF, PredictorTest, EvaluatorHoldout, EvaluatorOOF, AggregatorEvaluations, AggregatorTimes, LoggerFitStatus]
      >>> assert base_callback_class_sorter(in_4) == out_4
      >>> in_5 = [AggregatorEvaluations, PredictorTest, PredictorOOF, EvaluatorOOF, EvaluatorHoldout]
      >>> out_5 = [PredictorOOF, PredictorTest, EvaluatorHoldout, EvaluatorOOF, AggregatorEvaluations]
      >>> assert base_callback_class_sorter(in_5) == out_5
      >>> in_6 = [EvaluatorOOF, PredictorOOF, EvaluatorHoldout, AggregatorEvaluations, PredictorTest]
      >>> out_6 = [PredictorOOF, PredictorTest, EvaluatorHoldout, EvaluatorOOF, AggregatorEvaluations]
      >>> assert base_callback_class_sorter(in_6) == out_6
      >>> in_7 = [PredictorTest, EvaluatorHoldout, PredictorOOF]
      >>> out_7 = [PredictorOOF, PredictorTest, EvaluatorHoldout]
      >>> assert base_callback_class_sorter(in_7) == out_7
      >>> in_8 = [PredictorTest, PredictorOOF, EvaluatorHoldout]
      >>> out_8 = [PredictorOOF, PredictorTest, EvaluatorHoldout]
      >>> assert base_callback_class_sorter(in_8) == out_8
  
      >>> base_callback_class_sorter([type("Foo", (object,), {}), PredictorTest, EvaluatorHoldout, PredictorOOF])
      Traceback (most recent call last):
          File "experiment_core.py", line ?, in base_callback_class_sorter
      ValueError: Base class not descendant of acceptable parent class: [<class 'hyperparameter_hunter.experiment_core.Foo'>]
      """
      if parent_class_order is None:
          parent_class_order = [
              BaseInputWranglerCallback,
              BaseTargetWranglerCallback,
              BasePredictorCallback,
              BaseWranglerCallback,
              BaseEvaluatorCallback,
              BaseAggregatorCallback,
              BaseLoggerCallback,
              BaseCallback,
          ]
  
      sorted_auxiliary_bases = []
  
      for parent_class in parent_class_order:
          callback_holder = [
              _ for _ in auxiliary_bases if issubclass(_, parent_class)
          ]
          callback_holder = sorted(
              callback_holder, key=lambda _: _.__name__, reverse=False
          )
  
          auxiliary_bases = [
              _
              for _ in auxiliary_bases
              if not issubclass(_, parent_class)
          ]
          sorted_auxiliary_bases.extend(callback_holder)
  
      if len(auxiliary_bases) > 0:
          raise ValueError(
              f"Base class not descendant of acceptable parent class: {auxiliary_bases}"
          )
  
      return sorted_auxiliary_bases
  
file_path: hyperparameter_hunter/hyperparameter_hunter/experiment_core.py
imports: from hyperparameter_hunter.callbacks.aggregators import AggregatorEvaluations, AggregatorTimes
  from hyperparameter_hunter.callbacks.bases import BaseCallback, BaseInputWranglerCallback, BaseTargetWranglerCallback, BasePredictorCallback, BaseWranglerCallback, BaseEvaluatorCallback, BaseAggregatorCallback, BaseLoggerCallback
  from hyperparameter_hunter.callbacks.evaluators import EvaluatorOOF, EvaluatorHoldout
  from hyperparameter_hunter.callbacks.loggers import LoggerFitStatus
  from hyperparameter_hunter.callbacks.wranglers.input_wranglers import WranglerInputTrain, WranglerInputOOF, WranglerInputHoldout, WranglerInputTest
  from hyperparameter_hunter.callbacks.wranglers.predictors import PredictorOOF, PredictorHoldout, PredictorTest
  from hyperparameter_hunter.callbacks.wranglers.target_wranglers import WranglerTargetTrain, WranglerTargetOOF, WranglerTargetHoldout
  from hyperparameter_hunter.settings import G
  from inspect import currentframe, getframeinfo
  from os.path import abspath
label_desc: Use image node_id 1 for calling a global function with example usage: base_callback_class_sorter(auxiliary_bases, parent_class_order) and returns: sorted_auxiliary_bases