code: def check_imsave_condition(backend, img, as_uint16, auto_scale):
      if img.dtype not in [np.uint8, np.uint16]:
          if not auto_scale:
              return False
          if np.any(img < 0) or np.any(img > 1):
              return False
  
      if backend == "PilBackend":
          if img.dtype == np.uint16 or as_uint16:
              return False
      else:
          if img.dtype == np.uint16 and not as_uint16:
              return False
  
      return True
  
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 2 for calling a global function with example usage: check_imsave_condition(backend, img, as_uint16, auto_scale) and returns: True, False, False, False, False