code: def tnr_threshold(y_true, y_pred, tpr_threshold=0.0):
      """A function that returns the true negative rate if the true positive
      rate is higher or equal than `threshold`, and -1 otherwise. For testing
      purposes"""
      tpr, tnr = true_pos_true_neg_rates(y_true, y_pred)
      if tpr < tpr_threshold:
          return -1
      else:
          return tnr
  
imports: from functools import partial
  import pytest
  from numpy.testing import assert_array_equal
  from scipy.spatial.distance import euclidean
  from metric_learn.base_metric import _PairsClassifierMixin, MahalanobisMixin
  from sklearn.exceptions import NotFittedError
  from sklearn.metrics import f1_score, accuracy_score, fbeta_score, precision_score
  from sklearn.model_selection import train_test_split
  from test.test_utils import pairs_learners, ids_pairs_learners
  from metric_learn.sklearn_shims import set_random_state
  from sklearn import clone
  import numpy
  from itertools import product
label_desc: Use image node_id 12 for calling a global function with example usage: tnr_threshold(y_true, y_pred, tpr_threshold) and returns: unknown, tnr