code: def init_validate_scorers(
      scorers: t.Union[
          t.Mapping[str, t.Union[str, t.Callable]], t.List[str]
      ],
      model_classes: t.Optional[t.List],
      observed_classes: t.Optional[t.List],
  ) -> t.List[DeepcheckScorer]:
      """Initialize scorers and return all of them as deepchecks scorers.
  
      Parameters
      ----------
      scorers : Mapping[str, Union[str, Callable]]
          dict of scorers names to scorer sklearn_name/function or a list without a name
      model_classes : t.Optional[t.List]
          possible classes output for model. None for regression tasks.
      observed_classes : t.Optional[t.List]
          observed classes from labels and predictions. None for regression tasks.
  
      Returns
      -------
      t.List[DeepcheckScorer]
          A list of initialized scorers
      """
      if isinstance(scorers, t.Mapping):
          scorers: t.List[DeepcheckScorer] = [
              DeepcheckScorer(
                  scorer, model_classes, observed_classes, name
              )
              for name, scorer in scorers.items()
          ]
      else:
          scorers: t.List[DeepcheckScorer] = [
              DeepcheckScorer(scorer, model_classes, observed_classes)
              for scorer in scorers
          ]
      return scorers
  
file_path: deepchecks/deepchecks/nlp/metric_utils/scorers.py
imports: import typing
  import numpy
  from deepchecks.nlp.task_type import TaskType
  from deepchecks.nlp.text_data import TextData
  from deepchecks.tabular.metric_utils import DeepcheckScorer
  from deepchecks.tabular.metric_utils.scorers import _transform_to_multi_label_format
  from deepchecks.utils.metrics import is_label_none
  from deepchecks.utils.typing import ClassificationModel
label_desc: Use image node_id 1 for calling a global function with example usage: init_validate_scorers(scorers, model_classes, observed_classes) and returns: scorers