code: def test_sign_flip(
      y_pred: np.array,
      y_true: np.array,
      expected_score: float,
  ) -> None:
      """
      Expects
      -------
      * Flipping greater_is_better for r2_score result in flipped signs of its output.
      """
      greater_true_scorer = autosklearn.metrics.make_scorer(
          "r2", sklearn.metrics.r2_score, greater_is_better=True
      )
      greater_true_score = greater_true_scorer(y_true, y_pred)
      assert expected_score == pytest.approx(greater_true_score)
  
      greater_false_scorer = autosklearn.metrics.make_scorer(
          "r2", sklearn.metrics.r2_score, greater_is_better=False
      )
      greater_false_score = greater_false_scorer(y_true, y_pred)
      assert (expected_score * -1.0) == pytest.approx(
          greater_false_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 2 for calling a global function with example usage: test_sign_flip(y_pred, y_true, expected_score) without return types