code: def test_matthews_corrcoef(input_values):
      y_true = input_values["y_true"]
      y_pred = input_values["y_pred"]
      sample_weight = input_values["sample_weight"]
      expected_mcc = input_values["expected_matthews_corrcoef"]
      expected_mcc_with_weight = input_values[
          "expected_matthews_corrcoef_with_weight"
      ]
  
      # Tests list input.
      mcc = matthews_corrcoef(y_true=y_true, y_pred=y_pred)
      assert mcc == pytest.approx(expected_mcc)
  
      # Tests numpy array input.
      mcc = matthews_corrcoef(
          y_true=np.array(y_true), y_pred=np.array(y_pred)
      )
      assert mcc == pytest.approx(expected_mcc)
  
      # Tests pandas Series input.
      mcc = matthews_corrcoef(
          y_true=pd.Series(y_true), y_pred=pd.Series(y_pred)
      )
      assert mcc == pytest.approx(expected_mcc)
  
      # Tests pandas DataFrame input.
      mcc = matthews_corrcoef(
          y_true=pd.DataFrame(y_true), y_pred=pd.DataFrame(y_pred)
      )
      assert mcc == pytest.approx(expected_mcc)
  
      # Tests expected result when using sample weights.
      mcc = matthews_corrcoef(
          y_true=y_true, y_pred=y_pred, sample_weight=sample_weight
      )
      assert mcc == pytest.approx(expected_mcc_with_weight)
  
imports: import numpy
  import pandas
  import pytest
  from greykite.detection.common.ad_evaluation import confusion_matrix
  from greykite.detection.common.ad_evaluation import f1_score
  from greykite.detection.common.ad_evaluation import informedness_statistic
  from greykite.detection.common.ad_evaluation import matthews_corrcoef
  from greykite.detection.common.ad_evaluation import precision_score
  from greykite.detection.common.ad_evaluation import range_based_precision_score
  from greykite.detection.common.ad_evaluation import range_based_recall_score
  from greykite.detection.common.ad_evaluation import recall_score
  from greykite.detection.common.ad_evaluation import soft_f1_score
  from greykite.detection.common.ad_evaluation import soft_precision_score
  from greykite.detection.common.ad_evaluation import soft_recall_score
label_desc: Use image node_id 15 for calling a global function with example usage: test_matthews_corrcoef(input_values) without return types