code: def pil_image_to_ndarray(
      pil_image, grayscale, num_channels, return_palette_indices
  ):
      ret = PilBackend.convert_pil(
          pil_image, grayscale, num_channels, return_palette_indices
      )
      return np.asarray(ret).astype(np.uint8)
  
file_path: nnabla/python/src/nnabla/utils/image_utils/backend_events/pil_backend.py
imports: from __future__ import absolute_import, division
  import numpy
  from PIL import Image
  from nnabla.logger import logger
  from .common import _imread_before, _imread_after, _imsave_before, _imresize_before, _imresize_after
  from .image_utils_backend import ImageUtilsBackend
label_desc: Use image node_id 3 for calling the PilBackend obj's underlying member method code with example usage: obj.pil_image_to_ndarray(pil_image, grayscale, num_channels, return_palette_indices) and returns: np