code: def _is_distance_factory_callable(metric: Callable) -> bool:
      """Validate if a callable is a distance factory.
  
      Parameters
      ----------
      metric: Callable
          Callable to validate if is a valid distance factory.
  
      Returns
      -------
      bool
          Boolean that is true if callable is a valid distance factory and false
          if the callable is an invalid distance factory.
      """
      from sktime.distances._numba_utils import (
          is_no_python_compiled_callable,
      )
  
      is_no_python_compiled = is_no_python_compiled_callable(metric)
      if is_no_python_compiled:
          return False
      correct_num_params = (
          len(inspect.signature(metric).parameters) >= 2
      )
      return_type = inspect.signature(metric).return_annotation
      return_num_params = (
          return_type is not float
          and hasattr(return_type, "__len__")
          and len(return_type) == 1
      )
      return correct_num_params and return_num_params
  
file_path: sktime/sktime/distances/_resolve_metric.py
imports: import inspect
  from typing import Callable, List, Union
  import numpy
  from sktime.distances.base import DistanceCallable, MetricInfo, NumbaDistance
label_desc: Use image node_id 4 for calling a global function with example usage: _is_distance_factory_callable(metric) and returns: unknown, False