code: def _lexargmax(x: Tensor) -> Tensor:
      """Returns the index of the maximum value in a list of tuples according to lexicographic ordering.
  
      Based on https://stackoverflow.com/a/65615160
  
      """
      idx: Optional[Tensor] = None
      for k in range(x.shape[1]):
          col: Tensor = x[idx, k] if idx is not None else x[:, k]
          z = torch.where(col == col.max())[0]
          idx = z if idx is None else idx[z]
          if len(idx) < 2:
              break
      if idx is None:
          raise ValueError("Failed to extract index")
      return idx
  
file_path: torchmetrics/src/torchmetrics/functional/classification/recall_fixed_precision.py
imports: from typing import Callable, 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_compute, _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_compute, _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_compute, _multilabel_precision_recall_curve_format, _multilabel_precision_recall_curve_tensor_validation, _multilabel_precision_recall_curve_update
  from torchmetrics.utilities.enums import ClassificationTask
label_desc: Use image node_id 1 for calling a global function with example usage: _lexargmax(x) and returns: idx