code: def _sklearn_precision_recall_curve_multiclass(
      preds, target, ignore_index=None
  ):
      preds = np.moveaxis(preds.numpy(), 1, -1).reshape(
          (-1, preds.shape[1])
      )
      target = target.numpy().flatten()
      if not ((preds > 0) & (preds < 1)).all():
          preds = softmax(preds, 1)
      target, preds = remove_ignore_index(target, preds, ignore_index)
  
      precision, recall, thresholds = [], [], []
      for i in range(NUM_CLASSES):
          target_temp = np.zeros_like(target)
          target_temp[target == i] = 1
          res = sk_precision_recall_curve(target_temp, preds[:, i])
          precision.append(res[0])
          recall.append(res[1])
          thresholds.append(res[2])
      return [
          np.nan_to_num(x, nan=0.0)
          for x in [precision, recall, thresholds]
      ]
  
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 precision_recall_curve
  from torchmetrics.classification.precision_recall_curve import BinaryPrecisionRecallCurve, MulticlassPrecisionRecallCurve, MultilabelPrecisionRecallCurve, PrecisionRecallCurve
  from torchmetrics.functional.classification.precision_recall_curve import binary_precision_recall_curve, multiclass_precision_recall_curve, multilabel_precision_recall_curve
  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 2 for calling a global function with example usage: _sklearn_precision_recall_curve_multiclass(preds, target, ignore_index) and returns: unknown