code: def _preprocess_shapes(shapes):
      if shapes is None:
          return None
      if ia.is_np_array(shapes):
          assert shapes.ndim in [3, 4], (
              "Expected array 'shapes' to be 3- or 4-dimensional, got %d "
              "dimensions and shape %s instead."
              % (shapes.ndim, shapes.shape)
          )
          return [image.shape for image in shapes]
  
      assert isinstance(shapes, list), (
          "Expected 'shapes' to be None or ndarray or list, got type %s "
          "instead." % (type(shapes),)
      )
      result = []
      for shape_i in shapes:
          if isinstance(shape_i, tuple):
              result.append(shape_i)
          else:
              assert ia.is_np_array(shape_i), (
                  "Expected each entry in list 'shapes' to be either a "
                  "tuple or an ndarray, got type %s." % (type(shape_i),)
              )
              result.append(shape_i.shape)
      return result
  
imports: from __future__ import print_function, division, absolute_import
  import functools
  import numpy
  from ..None import imgaug
  from ..None import dtypes
  from .base import IAugmentable
label_desc: Use image node_id 1 for calling a global function with example usage: _preprocess_shapes(shapes) and returns: result, None, unknown