code: def make_shapes_callback(model):
      """Make a function for getting the shape of the pyramid levels."""
  
      def get_shapes(image_shape, pyramid_levels):
          shape = layer_shapes(image_shape, model)
          image_shapes = [
              shape["P{}".format(level)][1:3]
              for level in pyramid_levels
          ]
          return image_shapes
  
      return get_shapes
  
file_path: ImageAI/imageai_tf_deprecated/Detection/keras_retinanet/utils/anchors.py
imports: import numpy
  from tensorflow import keras
label_desc: Use image node_id 3 for calling a global function with example usage: make_shapes_callback(model) and returns: get_shapes, image_shapes