code: def test_minmax_auto_scale(img, as_uint16):
      rescaled = image_utils.minmax_auto_scale(img, as_uint16)
  
      # check dtype
      if as_uint16:
          assert rescaled.dtype == np.uint16
          scale_max = 65535
      else:
          assert rescaled.dtype == np.uint8
          scale_max = 255
  
      # check the range of values
      assert rescaled.max() <= scale_max
      assert rescaled.min() >= 0
  
      # check if correctly scaled up
      reverted = (
          image_utils.backend_events.common.rescale_pixel_intensity(
              rescaled,
              rescaled.min(),
              rescaled.max(),
              img.min(),
              img.max(),
              img.dtype,
          )
      )
      assert_allclose(img, reverted, atol=1 / 2**4)
  
file_path: nnabla/python/test/utils/test_image_utils.py
imports: from __future__ import division
  import pytest
  import numpy
  from nnabla.utils import image_utils
  from nnabla.logger import logger
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 4 for calling a global function with example usage: test_minmax_auto_scale(img, as_uint16) without return types