code: def get_img_shape(img):
      """Returns image shape in a backend agnostic manner.
  
      Args:
          img: An image tensor of shape: `(channels, image_dims...)` if data_format='channels_first' or
              `(image_dims..., channels)` if data_format='channels_last'.
  
      Returns:
          Tuple containing image shape information in `(samples, channels, image_dims...)` order.
      """
      if isinstance(img, np.ndarray):
          shape = img.shape
      else:
          shape = K.int_shape(img)
  
      if K.image_data_format() == "channels_last":
          shape = list(shape)
          shape.insert(1, shape[-1])
          shape = tuple(shape[:-1])
      return shape
  
imports: from __future__ import absolute_import
  from __future__ import division
  import os
  import tempfile
  import math
  import json
  import six
  import numpy
  import matplotlib.font_manager
  from skimage import io, transform
  from keras import backend
  from keras.models import load_model
  import logging
label_desc: Use image node_id 12 for calling a global function with example usage: get_img_shape(img) and returns: shape