code: def _specificity_at_sensitivity_x_multilabel(
      predictions, targets, min_sensitivity
  ):
      # get fpr, tpr and thresholds
      fpr, sensitivity, thresholds = sk_roc_curve(
          targets, predictions, pos_label=1.0, drop_intermediate=False
      )
      # check if fpr is filled with nan (All positive samples),
      # replace nan with zero tensor
      if np.isnan(fpr).all():
          fpr = np.zeros_like(thresholds)
  
      # convert fpr to specificity (specificity = 1 - fpr)
      specificity = _convert_fpr_to_specificity(fpr)
  
      # get indices where sensitivity is greater than min_sensitivity
      indices = sensitivity >= min_sensitivity
  
      # if no indices are found, max_spec, best_threshold = 0.0, 1e6
      if not indices.any():
          max_spec, best_threshold = 0.0, 1e6
      else:
          # redefine specificity, sensitivity and threshold tensor based on indices
          specificity, sensitivity, thresholds = (
              specificity[indices],
              sensitivity[indices],
              thresholds[indices],
          )
  
          # get argmax
          idx = np.argmax(specificity)
  
          # get max_spec and best_threshold
          max_spec, best_threshold = specificity[idx], thresholds[idx]
  
      return float(max_spec), float(best_threshold)
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from scipy.special import softmax
  from sklearn.metrics import roc_curve
  from torchmetrics.classification.specificity_sensitivity import BinarySpecificityAtSensitivity, MulticlassSpecificityAtSensitivity, MultilabelSpecificityAtSensitivity, SpecificityAtSensitivity
  from torchmetrics.functional.classification.specificity_sensitivity import _convert_fpr_to_specificity, binary_specificity_at_sensitivity, multiclass_specificity_at_sensitivity, multilabel_specificity_at_sensitivity
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES
  from unittests.classification.inputs import _binary_cases, _multiclass_cases, _multilabel_cases
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
label_desc: Use image node_id 1 for calling a global function with example usage: _specificity_at_sensitivity_x_multilabel(predictions, targets, min_sensitivity) and returns: float,  float