code: def get_scorer(
      score_func: Union[str, Callable], **kwargs
  ) -> Callable:
      """
      Get a scorer from string
  
      Parameters
      ----------
      score_func : str | callable
          scoring method as string. If callable it is returned as is.
  
      Returns
      -------
      scorer : callable
          The scorer.
      """
      if isinstance(score_func, str):
          try:
              scorer = SCORERS[score_func]
          except KeyError:
              raise ValueError(
                  "{} is not a valid scoring value. "
                  "Valid options are {}".format(
                      score_func, sorted(SCORERS)
                  )
              )
          return scorer
      else:
          return make_scorer(score_func, **kwargs)
  
imports: from typing import Callable, Union
  from sklearn.metrics import make_scorer
  from .None import accuracy_score, log_loss, r2_score
label_desc: Use image node_id 1 for calling a global function with example usage: get_scorer(score_func) and returns: scorer, make_scorer