code: def get_img_channel(image_path):
      """
      Load a image and return the channel of the image
      :param image_path:
      :return: the channel of the image
      """
      img = load_image(image_path)
      img = pil_to_nparray(img)
      try:
          channel = img.shape[2]
      except:
          channel = 1
      return channel
  
imports: from __future__ import division, print_function, absolute_import
  import os
  import random
  import numpy
  from PIL import Image
  import pickle
  import csv
  import warnings
  import tensorflow.compat.v1
  from io import BytesIO
label_desc: Use image node_id 9 for calling a global function with example usage: get_img_channel(image_path) and returns: channel