code: def normalize_imglike_shape(shape):
      """Normalize a shape tuple or image-like ``array`` to a shape tuple.
  
      Added in 0.5.0.
  
      Parameters
      ----------
      shape : tuple of int or ndarray
          The input to normalize. May optionally be an array. If it is an
          array, it must be 2-dimensional (height, width) or 3-dimensional
          (height, width, channels). Otherwise an error will be raised.
  
      Returns
      -------
      tuple of int
          Shape ``tuple``.
  
      """
      if isinstance(shape, tuple):
          return shape
      assert ia.is_np_array(
          shape
      ), "Expected tuple of ints or array, got %s." % (type(shape),)
      shape = shape.shape
      assert len(shape) in [2, 3], (
          "Expected image array to be 2-dimensional or 3-dimensional, got "
          "%d-dimensional input of shape %s." % (len(shape), shape)
      )
      return shape
  
file_path: imgaug/imgaug/augmentables/utils.py
imports: from __future__ import print_function, division, absolute_import
  import copy
  import numpy
  import six.moves
  import imgaug
label_desc: Use image node_id 5 for calling a global function with example usage: normalize_imglike_shape(shape) and returns: shape, shape