code: def _skimage_uqi(preds, target, multichannel, kernel_size):
      c, h, w = preds.shape[-3:]
      sk_preds = preds.view(-1, c, h, w).permute(0, 2, 3, 1).numpy()
      sk_target = target.view(-1, c, h, w).permute(0, 2, 3, 1).numpy()
      if not multichannel:
          sk_preds = sk_preds[:, :, :, 0]
          sk_target = sk_target[:, :, :, 0]
  
      return skimage_uqi(
          sk_target,
          sk_preds,
          data_range=1.0,
          multichannel=multichannel,
          gaussian_weights=True,
          win_size=kernel_size,
          sigma=1.5,
          use_sample_covariance=False,
          channel_axis=-1,
      )
  
imports: from functools import partial
  from typing import NamedTuple
  import pytest
  import torch
  from skimage.metrics import structural_similarity
  from torch import Tensor
  from torchmetrics.functional.image.uqi import universal_image_quality_index
  from torchmetrics.image.uqi import UniversalImageQualityIndex
  from unittests import BATCH_SIZE, NUM_BATCHES
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling a global function with example usage: _skimage_uqi(preds, target, multichannel, kernel_size) and returns: skimage_uqi