code: def _imread_before(grayscale, num_channels):
      # pre-process for imread. check arguments.
      if num_channels not in [-1, 0, 1, 3, 4]:
          raise ValueError(
              "Currently num_channels supports [-1, 0, 1, 3, 4]."
          )
  
      if not grayscale and num_channels in [0, 1]:
          raise ValueError(
              "If grayscale=False, num_channels must be [-1, 3, 4]."
              "If you want to get image as gray-scale, try grayscale=True "
          )
  
file_path: nnabla/python/src/nnabla/utils/image_utils/backend_events/common.py
imports: from __future__ import division, absolute_import
  import numpy
  from nnabla.logger import logger
label_desc: Use image node_id 7 for calling a global function with example usage: _imread_before(grayscale, num_channels) without return types