code: def _check_metric(metric):
      if isinstance(metric, str):
          metric_mean = metric
          metric_dist = metric
  
      elif isinstance(metric, dict):
          # check keys
          for key in ["mean", "distance"]:
              if key not in metric.keys():
                  raise KeyError(
                      'metric must contain "mean" and "distance"'
                  )
  
          metric_mean = metric["mean"]
          metric_dist = metric["distance"]
  
      else:
          raise TypeError("metric must be dict or str")
  
      return metric_mean, metric_dist
  
imports: import functools
  import numpy
  from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin
  from sklearn.svm import SVC
  from sklearn.utils.extmath import softmax
  from sklearn.linear_model import LogisticRegression
  from sklearn.pipeline import make_pipeline
  from joblib import Parallel, delayed
  import warnings
  from .utils.kernel import kernel
  from .utils.mean import mean_covariance, mean_power
  from .utils.distance import distance
  from .tangentspace import FGDA, TangentSpace
label_desc: Use image node_id 1 for calling a global function with example usage: _check_metric(metric) and returns: metric_mean,  metric_dist