code: def test_informedness_statistic(input_values):
      y_true = input_values["y_true"]
      y_pred = input_values["y_pred"]
      sample_weight = input_values["sample_weight"]
      expected_informedness = input_values[
          "expected_informedness_statistic"
      ]
      expected_informedness_with_weight = input_values[
          "expected_informedness_statistic_with_weight"
      ]
  
      # Tests list input.
      informedness = informedness_statistic(
          y_true=y_true, y_pred=y_pred
      )
      assert informedness == pytest.approx(expected_informedness)
  
      # Tests numpy array input.
      informedness = informedness_statistic(
          y_true=np.array(y_true), y_pred=np.array(y_pred)
      )
      assert informedness == pytest.approx(expected_informedness)
  
      # Tests pandas Series input.
      informedness = informedness_statistic(
          y_true=pd.Series(y_true), y_pred=pd.Series(y_pred)
      )
      assert informedness == pytest.approx(expected_informedness)
  
      # Tests pandas DataFrame input.
      informedness = informedness_statistic(
          y_true=pd.DataFrame(y_true), y_pred=pd.DataFrame(y_pred)
      )
      assert informedness == pytest.approx(expected_informedness)
  
      # Tests expected result when using sample weights.
      informedness = informedness_statistic(
          y_true=y_true, y_pred=y_pred, sample_weight=sample_weight
      )
      assert informedness == pytest.approx(
          expected_informedness_with_weight
      )
  
      # Tests that informedness_statistic returns the same results as sensitivity + specificity - 1 for binary output.
      y_true = ["0", "0", "0", "0", "0", "1", "1", "1"]
      y_pred = ["0", "0", "0", "1", "1", "1", "1", "1"]
      informedness = informedness_statistic(
          y_true=y_true, y_pred=y_pred, sample_weight=None
      )
      recalls = recall_score(
          y_true=y_true, y_pred=y_pred, sample_weight=None
      )
      assert informedness == sum(recalls.values()) - 1.0
  
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 16 for calling a global function with example usage: test_informedness_statistic(input_values) without return types