code: def test_scorer(
      y_pred: np.ndarray,
      y_true: np.ndarray,
      scorer: autosklearn.metrics.Scorer,
      expected_score: float,
  ) -> None:
      """
      Expects
      -------
      * Expected scores are equal to scores gained from implementing assembled scorers.
      """
      result_score = scorer(y_true, y_pred)
      assert expected_score == pytest.approx(result_score)
  
imports: import warnings
  import numpy
  import sklearn.metrics
  import autosklearn.metrics
  from autosklearn.constants import BINARY_CLASSIFICATION, REGRESSION
  from autosklearn.metrics import calculate_losses, calculate_scores, compute_single_metric
  import pytest
  import unittest
label_desc: Use image node_id 1 for calling a global function with example usage: test_scorer(y_pred, y_true, scorer, expected_score) without return types