code: def test_defences_pytorch_and_nonpytorch(
      art_warning,
      get_default_mnist_subset,
      image_dl_estimator,
      device_type,
  ):
      try:
          smooth_3x3_nonpth = SpatialSmoothing(
              window_size=3, channels_first=True
          )
          smooth_3x3_pth = SpatialSmoothingPyTorch(
              window_size=3,
              channels_first=True,
              device_type=device_type,
          )
          preprocessing_defences = [smooth_3x3_nonpth, smooth_3x3_pth]
          _test_preprocessing_defences_forward(
              get_default_mnist_subset,
              image_dl_estimator,
              device_type,
              preprocessing_defences,
          )
          _test_preprocessing_defences_backward(
              get_default_mnist_subset,
              image_dl_estimator,
              device_type,
              preprocessing_defences,
          )
      except ARTTestException as e:
          art_warning(e)
  
imports: import numpy
  import pytest
  import torch
  import torch.nn.functional
  import torch.nn
  import torch.optim
  import sklearn.datasets
  from art.estimators.classification.pytorch import PyTorchClassifier
  from art.defences.preprocessor.spatial_smoothing import SpatialSmoothing
  from art.defences.preprocessor.spatial_smoothing_pytorch import SpatialSmoothingPyTorch
  from art.attacks.evasion.fast_gradient import FastGradientMethod
  from art.attacks.evasion.projected_gradient_descent.projected_gradient_descent import ProjectedGradientDescent
  from tests.attacks.utils import backend_test_defended_images
  from tests.utils import ARTTestException
label_desc: Use image node_id 7 for calling a global function with example usage: test_defences_pytorch_and_nonpytorch(art_warning, get_default_mnist_subset, image_dl_estimator, device_type) without return types