code: def test_scale_image():
      image_shape = (28, 28, 1)
      scaling_offset = 260
      min_val = 0
      max_val = 255
  
      fake_img = np.random.random(size=image_shape) + scaling_offset
      scaled_img = scale_image(fake_img, scale=(min_val, max_val))
      assert (scaled_img <= max_val).all()
      assert (scaled_img >= min_val).all()
  
file_path: alibi/alibi/explainers/tests/test_anchor_image.py
imports: import pytest
  from pytest_lazyfixture import lazy_fixture
  import numpy
  import tensorflow
  import torch
  from alibi.api.defaults import DEFAULT_META_ANCHOR, DEFAULT_DATA_ANCHOR_IMG
  from alibi.exceptions import PredictorCallError, PredictorReturnTypeError
  from alibi.explainers.anchors.anchor_image import AnchorImage, AnchorImageSampler, scale_image
label_desc: Use image node_id 1 for calling a global function with example usage: test_scale_image() without return types