code: def test_d_s_invalid_inputs(
      preds, ms, pan, pan_lr, norm_order, window_size, match
  ):
      """Test that invalid input raises the correct errors."""
      preds_t = torch.rand(preds)
      ms_t = torch.rand(ms)
      pan_t = torch.rand(pan)
      pan_lr_t = torch.rand(pan_lr) if pan_lr is not None else None
      with pytest.raises(ValueError, match=match):
          spatial_distortion_index(
              preds_t, ms_t, pan_t, pan_lr_t, norm_order, window_size
          )
  
imports: from functools import partial
  from typing import Dict, List, NamedTuple
  import numpy
  import pytest
  import torch
  from scipy.ndimage import uniform_filter
  from skimage.transform import resize
  from torch import Tensor
  from torchmetrics.functional.image.d_s import spatial_distortion_index
  from torchmetrics.functional.image.uqi import universal_image_quality_index
  from torchmetrics.image.d_s import SpatialDistortionIndex
  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 4 for calling a global function with example usage: test_d_s_invalid_inputs(preds, ms, pan, pan_lr, norm_order, window_size, match) without return types