code: def test_against_sklearn_weighted(self):
      y_true = [
          0,
          1,
          0,
          1,
          1,
          1,
          0,
          0,
          1,
          1,
          0,
          1,
          1,
          0,
          1,
          0,
          1,
          0,
          1,
          0,
          1,
          1,
          1,
          0,
          1,
          0,
          1,
          0,
          1,
          0,
      ]
      y_pred = [
          0,
          0,
          1,
          1,
          0,
          1,
          0,
          1,
          0,
          1,
          1,
          1,
          0,
          1,
          0,
          1,
          0,
          1,
          0,
          1,
          0,
          1,
          1,
          1,
          1,
          0,
          0,
          1,
          0,
          1,
      ]
      weights = [
          1,
          2,
          3,
          5,
          3,
          2,
          5,
          3,
          5,
          1,
          5,
          3,
          5,
          2,
          3,
          2,
          5,
          2,
          3,
          1,
          5,
          3,
          2,
          1,
          1,
          5,
          2,
          3,
          5,
          1,
      ]
  
      actual = metrics.true_negative_rate(
          y_true, y_pred, sample_weight=weights
      )
      tn, fp, fn, tp = skm.confusion_matrix(
          y_true, y_pred, sample_weight=weights
      ).ravel()
      assert (tn / (tn + fp)) == actual
      actual = metrics.true_negative_rate(
          y_true, y_pred, pos_label=0, sample_weight=weights
      )
      tn, fp, fn, tp = skm.confusion_matrix(
          y_true, y_pred, labels=[1, 0], sample_weight=weights
      ).ravel()
      assert (tn / (tn + fp)) == actual
  
imports: import numpy
  import pytest
  import sklearn.metrics
  import fairlearn.metrics
  from fairlearn.metrics._base_metrics import _get_labels_for_confusion_matrix
label_desc: Use image node_id 7 for calling the TestTNR obj's underlying member method code with example usage: obj.test_against_sklearn_weighted() without return types