code: def load_image_imread(file, shape=None, max_range=1.0):
      """
      Load image from file like object.
  
      :param file: Image contents
      :type file: file like object.
      :param shape: shape of output array
          e.g. (3, 128, 192) : n_color, height, width.
      :type shape: tuple of int
      :param float max_range: the value of return array ranges from 0 to `max_range`.
  
      :return: numpy array
  
      """
      orig_img = imread(
          file
      )  # return value is from zero to 255 (even if the image has 16-bitdepth.)
  
      if len(orig_img.shape) == 2:  # gray image
          height, width = orig_img.shape
          if shape is None:
              out_height, out_width, out_n_color = height, width, 1
          else:
              out_n_color, out_height, out_width = shape
          assert out_n_color == 1
          if out_height != height or out_width != width:
              # imresize returns 0 to 255 image.
              orig_img = imresize(orig_img, (out_height, out_width))
          orig_img = orig_img.reshape(
              (out_n_color, out_height, out_width)
          )
      elif len(orig_img.shape) == 3:  # RGB image
          height, width, n_color = orig_img.shape
          if shape is None:
              out_height, out_width, out_n_color = (
                  height,
                  width,
                  n_color,
              )
          else:
              out_n_color, out_height, out_width = shape
          assert out_n_color == n_color
          if (
              out_height != height
              or out_width != width
              or out_n_color != n_color
          ):
              # imresize returns 0 to 255 image.
              orig_img = imresize(
                  orig_img, (out_height, out_width, out_n_color)
              )
          orig_img = orig_img.transpose(2, 0, 1)
  
      if max_range < 0:
          return orig_img
      else:
          # 16bit depth
          if orig_img.dtype == "uint16":
              if max_range == 65535.0:
                  return orig_img
              return orig_img * (max_range / 65535.0)
          # 8bit depth (default)
          else:
              if max_range == 255.0:
                  return orig_img
              return orig_img * (max_range / 255.0)
  
imports: from __future__ import absolute_import
  import contextlib
  import csv
  import warnings
  from six import BytesIO
  from six import StringIO
  from six.moves import map
  from six.moves.urllib.parse import urljoin
  import h5py
  import numpy
  import scipy.io.wavfile
  import os
  import urllib.request
  import six
  import tempfile
  import binascii
  from shutil import rmtree
  from nnabla.utils.image_utils import imresize, imread
  from nnabla.utils.audio_utils import auresize, auread
  from nnabla.logger import logger
  from .download import download, get_data_home
label_desc: Use image node_id 2 for calling a global function with example usage: load_image_imread(file, shape, max_range) and returns: orig_img, unknown, unknown, orig_img, orig_img