code: def test_center_crop(self):
      image = np.random.randint(0, 256, (3, 224, 224))
  
      # Test that exception is raised if inputs are incorrect
      with self.assertRaises(ValueError):
          center_crop(image, 10)
  
      # Test result is correct - output data format is channels_first and center crop
      # correctly computed
      expected_image = image[:, 52:172, 82:142].transpose(1, 2, 0)
      cropped_image = center_crop(
          image, (120, 60), data_format="channels_last"
      )
      self.assertIsInstance(cropped_image, np.ndarray)
      self.assertEqual(cropped_image.shape, (120, 60, 3))
      self.assertTrue(np.allclose(cropped_image, expected_image))
  
      # Test that image is padded with zeros if crop size is larger than image size
      expected_image = np.zeros((300, 260, 3))
      expected_image[38:262, 18:242, :] = image.transpose((1, 2, 0))
      cropped_image = center_crop(
          image, (300, 260), data_format="channels_last"
      )
      self.assertIsInstance(cropped_image, np.ndarray)
      self.assertEqual(cropped_image.shape, (300, 260, 3))
      self.assertTrue(np.allclose(cropped_image, expected_image))
  
      # Test image with 4 channels is cropped correctly
      image = np.random.randint(0, 256, (224, 224, 4))
      expected_image = image[52:172, 82:142, :]
      self.assertTrue(
          np.allclose(
              center_crop(
                  image, (120, 60), input_data_format="channels_last"
              ),
              expected_image,
          )
      )
  
imports: import unittest
  import numpy
  from parameterized import parameterized
  from transformers.testing_utils import require_flax, require_tf, require_torch, require_vision
  from transformers.utils.import_utils import is_flax_available, is_tf_available, is_torch_available, is_vision_available
label_desc: Use image node_id 11 for calling the ImageTransformsTester obj's underlying member method code with example usage: obj.test_center_crop() without return types