code: def _resolve_average_callable(
      averaging_method: [str, Callable[[np.ndarray], np.ndarray]]
  ) -> Callable[[np.ndarray, Dict], np.ndarray]:
      """Resolve a string or callable to a averaging callable.
  
      Parameters
      ----------
      averaging_method: str or Callable, defaults = 'mean'
          Averaging method to compute the average of a cluster. Any of the following
          strings are valid: ['mean']. If a Callable is provided must take the form
          Callable[[np.ndarray], np.ndarray].
  
      Returns
      -------
      Callable[[np.ndarray], np.ndarray]
          Averaging method based on params.
      """
      if isinstance(averaging_method, str):
          if averaging_method not in _AVERAGE_DICT:
              raise ValueError(
                  "averaging_method string is invalid. Please use one of the"
                  "following",
                  _AVERAGE_DICT.keys(),
              )
          return _AVERAGE_DICT[averaging_method]
  
      return averaging_method
  
imports: from typing import Callable, Dict
  import numpy
  from sktime.clustering.metrics.averaging._dba import dba
label_desc: Use image node_id 2 for calling a global function with example usage: _resolve_average_callable(averaging_method) and returns: averaging_method, _AVERAGE_DICT