code: def test_shift_and_scale_normalizer():
      """Test the ShiftAndScaleNormalizer
  
      - Test the ShiftAndScaleNormalizer correctly normalizes data passed to it
      - Test the ShiftAndScaleNormalizer throws the correct errors if not fit.
      """
      normalizer = ensemble.ShiftAndScaleNormalizer()
      x = torch.randn(3, 10) * 3 + 2
      x_ref = torch.randn(5000, 10) * 3 + 2
  
      # unfit normalizer raises exception
      with pytest.raises(NotFittedError) as err:
          normalizer(x)
      assert (
          err.value.args[0]
          == "ShiftAndScaleNormalizer has not been fit!"
      )
  
      # test the normalizer correctly shifts and scales the data
      normalizer.fit(x_ref)
      x_norm = normalizer(x)
      assert torch.isclose(x_norm.mean(), torch.tensor(0.0), atol=0.1)
      assert torch.isclose(x_norm.std(), torch.tensor(1.0), atol=0.1)
  
      # Test the scriptability of the normalizer
      normalizer = torch.jit.script(normalizer)
      x_norm_2 = normalizer(x)
      assert torch.all(x_norm_2 == x_norm)
  
file_path: alibi-detect/alibi_detect/od/tests/test_ensemble.py
imports: import pytest
  import torch
  from alibi_detect.od.pytorch import ensemble
  from alibi_detect.exceptions import NotFittedError
label_desc: Use image node_id 2 for calling a global function with example usage: test_shift_and_scale_normalizer() without return types