code: def test_preprocessing(fmodel_and_data: ModelAndData) -> None:
      fmodel, x, y = fmodel_and_data
      if not isinstance(fmodel, fbn.models.base.ModelWithPreprocessing):
          pytest.skip()
          assert False
  
      preprocessing = dict(mean=[3, 3, 3], std=[5, 5, 5], axis=-3)
      fmodel = fbn.models.base.ModelWithPreprocessing(
          fmodel._model, fmodel.bounds, fmodel.dummy, preprocessing
      )
  
      preprocessing = dict(mean=[3, 3, 3], axis=-3)
      fmodel = fbn.models.base.ModelWithPreprocessing(
          fmodel._model, fmodel.bounds, fmodel.dummy, preprocessing
      )
  
      preprocessing = dict(mean=np.array([3, 3, 3]), axis=-3)
      fmodel = fbn.models.base.ModelWithPreprocessing(
          fmodel._model, fmodel.bounds, fmodel.dummy, preprocessing
      )
  
      # std -> foo
      preprocessing = dict(mean=[3, 3, 3], foo=[5, 5, 5], axis=-3)
      with pytest.raises(ValueError):
          fmodel = fbn.models.base.ModelWithPreprocessing(
              fmodel._model, fmodel.bounds, fmodel.dummy, preprocessing
          )
  
      # axis positive
      preprocessing = dict(mean=[3, 3, 3], std=[5, 5, 5], axis=1)
      with pytest.raises(ValueError):
          fmodel = fbn.models.base.ModelWithPreprocessing(
              fmodel._model, fmodel.bounds, fmodel.dummy, preprocessing
          )
  
      preprocessing = dict(mean=3, std=5)
      fmodel = fbn.models.base.ModelWithPreprocessing(
          fmodel._model, fmodel.bounds, fmodel.dummy, preprocessing
      )
  
      # axis with 1D mean
      preprocessing = dict(mean=3, std=[5, 5, 5], axis=-3)
      with pytest.raises(ValueError):
          fmodel = fbn.models.base.ModelWithPreprocessing(
              fmodel._model, fmodel.bounds, fmodel.dummy, preprocessing
          )
  
      # axis with 1D std
      preprocessing = dict(mean=[3, 3, 3], std=5, axis=-3)
      with pytest.raises(ValueError):
          fmodel = fbn.models.base.ModelWithPreprocessing(
              fmodel._model, fmodel.bounds, fmodel.dummy, preprocessing
          )
  
file_path: foolbox/tests/test_models.py
imports: from typing import Tuple, Any
  import pytest
  import eagerpy
  import numpy
  import copy
  import foolbox
label_desc: Use image node_id 10 for calling a global function with example usage: test_preprocessing(fmodel_and_data) without return types