code: def specificity_at_sensitivity(
      preds: Tensor,
      target: Tensor,
      task: Literal["binary", "multiclass", "multilabel"],
      min_sensitivity: float,
      thresholds: Optional[Union[int, List[float], Tensor]] = None,
      num_classes: Optional[int] = None,
      num_labels: Optional[int] = None,
      ignore_index: Optional[int] = None,
      validate_args: bool = True,
  ) -> Union[
      Tensor,
      Tuple[Tensor, Tensor, Tensor],
      Tuple[List[Tensor], List[Tensor], List[Tensor]],
  ]:
      r"""Compute the highest possible specificity value given the minimum sensitivity thresholds provided.
  
      This is done by first calculating the Receiver Operating Characteristic (ROC) curve for different thresholds and
      the find the specificity for a given sensitivity level.
  
      This function is a simple wrapper to get the task specific versions of this metric, which is done by setting the
      ``task`` argument to either ``'binary'``, ``'multiclass'`` or ``multilabel``. See the documentation of
      :func:`~torchmetrics.functional.classification.binary_specificity_at_sensitivity`,
      :func:`~torchmetrics.functional.classification.multiclass_specificity_at_sensitivity` and
      :func:`~torchmetrics.functional.classification.multilabel_specificity_at_sensitivity` for the specific details of
      each argument influence and examples.
  
      """
      task = ClassificationTask.from_str(task)
      if task == ClassificationTask.BINARY:
          return binary_specificity_at_sensitivity(  # type: ignore
              preds,
              target,
              min_sensitivity,
              thresholds,
              ignore_index,
              validate_args,
          )
      if task == ClassificationTask.MULTICLASS:
          if not isinstance(num_classes, int):
              raise ValueError(
                  f"`num_classes` is expected to be `int` but `{type(num_classes)} was passed.`"
              )
          return multiclass_specificity_at_sensitivity(  # type: ignore
              preds,
              target,
              num_classes,
              min_sensitivity,
              thresholds,
              ignore_index,
              validate_args,
          )
      if task == ClassificationTask.MULTILABEL:
          if not isinstance(num_labels, int):
              raise ValueError(
                  f"`num_labels` is expected to be `int` but `{type(num_labels)} was passed.`"
              )
          return multilabel_specificity_at_sensitivity(  # type: ignore
              preds,
              target,
              num_labels,
              min_sensitivity,
              thresholds,
              ignore_index,
              validate_args,
          )
      raise ValueError(f"Not handled value: {task}")
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics.functional.classification.precision_recall_curve import _binary_precision_recall_curve_arg_validation, _binary_precision_recall_curve_format, _binary_precision_recall_curve_tensor_validation, _binary_precision_recall_curve_update, _multiclass_precision_recall_curve_arg_validation, _multiclass_precision_recall_curve_format, _multiclass_precision_recall_curve_tensor_validation, _multiclass_precision_recall_curve_update, _multilabel_precision_recall_curve_arg_validation, _multilabel_precision_recall_curve_format, _multilabel_precision_recall_curve_tensor_validation, _multilabel_precision_recall_curve_update
  from torchmetrics.functional.classification.roc import _binary_roc_compute, _multiclass_roc_compute, _multilabel_roc_compute
  from torchmetrics.utilities.enums import ClassificationTask
label_desc: Use image node_id 13 for calling a global function with example usage: specificity_at_sensitivity(preds, target, task, min_sensitivity, thresholds, num_classes, num_labels, ignore_index, validate_args) and returns: binary_specificity_at_sensitivity, multiclass_specificity_at_sensitivity, multilabel_specificity_at_sensitivity