code: def get_scorer(
      scoring: Union[str, Callable], compute: bool = True
  ) -> Callable:
      """Get a scorer from string
  
      Parameters
      ----------
      scoring : str | callable
          scoring method as string. If callable it is returned as is.
  
      Returns
      -------
      scorer : callable
          The scorer.
      """
      # This is the same as sklearns, only we use our SCORERS dict,
      # and don't have back-compat code
      if isinstance(scoring, str):
          try:
              scorer, kwargs = SCORERS[scoring]
          except KeyError:
              raise ValueError(
                  "{} is not a valid scoring value. "
                  "Valid options are {}".format(
                      scoring, sorted(SCORERS)
                  )
              )
      else:
          scorer = scoring
          kwargs = {}
  
      kwargs["compute"] = compute
  
      return make_scorer(scorer, **kwargs)
  
imports: from typing import Any, Callable, Tuple, Union
  from sklearn.metrics import check_scoring, make_scorer
  from .None import accuracy_score, log_loss, mean_squared_error, r2_score
label_desc: Use image node_id 1 for calling a global function with example usage: get_scorer(scoring, compute) and returns: make_scorer