code: def _add_scorer_to_metric_dict(metric_dict, scorer):
      if scorer.name in metric_dict:
          raise ValueError(
              f"Duplicated score name found! scorer={scorer}, name={scorer.name}. "
              f"Consider to register with a different name."
          )
      metric_dict[scorer.name] = scorer
      for alias in scorer.alias:
          if alias in metric_dict:
              raise ValueError(
                  f"Duplicated alias found! scorer={scorer}, alias={alias}. "
                  f"Consider to use a different alias."
              )
          metric_dict[alias] = scorer
  
imports: import json
  from abc import ABCMeta, abstractmethod
  from functools import partial
  import numpy
  import scipy
  import scipy.stats
  import sklearn.metrics
  from ..constants import BINARY, MULTICLASS, QUANTILE, REGRESSION, SOFTCLASS
  from .None import classification_metrics, quantile_metrics
  from .classification_metrics import confusion_matrix
label_desc: Use image node_id 1 for calling a global function with example usage: _add_scorer_to_metric_dict(metric_dict, scorer) without return types