code: def test_cropping_2d_with_dynamic_spatial_dim(self):
      if backend.config.image_data_format() == "channels_last":
          input_layer = layers.Input(batch_shape=(1, 7, None, 5))
      else:
          input_layer = layers.Input(batch_shape=(1, 5, 7, None))
      cropped = layers.Cropping2D(((1, 2), (3, 4)))(input_layer)
      if backend.config.image_data_format() == "channels_last":
          self.assertEqual(cropped.shape, (1, 4, None, 5))
      else:
          self.assertEqual(cropped.shape, (1, 5, 4, None))
  
file_path: keras/keras/layers/reshaping/cropping2d_test.py
imports: import numpy
  import pytest
  from absl.testing import parameterized
  from keras import backend
  from keras import layers
  from keras import ops
  from keras import testing
label_desc: Use image node_id 2 for calling the Cropping2DTest obj's underlying member method code with example usage: obj.test_cropping_2d_with_dynamic_spatial_dim() without return types