code: def _scipy_spearman(preds, target):
      if preds.ndim == 2:
          return [
              spearmanr(t.numpy(), p.numpy())[0]
              for t, p in zip(target.T, preds.T)
          ]
      return spearmanr(target.numpy(), preds.numpy())[0]
  
file_path: torchmetrics/tests/unittests/regression/test_spearman.py
imports: from functools import partial
  import pytest
  import torch
  from scipy.stats import rankdata, spearmanr
  from torchmetrics.functional.regression.spearman import _rank_data, spearman_corrcoef
  from torchmetrics.regression.spearman import SpearmanCorrCoef
  from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_2_1
  from unittests import BATCH_SIZE, EXTRA_DIM, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 2 for calling a global function with example usage: _scipy_spearman(preds, target) and returns: spearmanr, unknown