docstr: This function prepares a list of PIL images, or a list of numpy arrays if one specifies numpify=True,
  or a list of PyTorch tensors if one specifies torchify=True.
docstr_tok: ["This","function","prepares","a","list","of","PIL","images",",","or","a","list","of","numpy","arrays","if","one","specifies","numpify=True",",","or","a","list","of","PyTorch","tensors","if","one","specifies","torchify=True","."]
code: def prepare_inputs(
      self, equal_resolution=False, numpify=False, torchify=False
  ):
      """This function prepares a list of PIL images, or a list of numpy arrays if one specifies numpify=True,
      or a list of PyTorch tensors if one specifies torchify=True.
      """
  
      assert not (
          numpify and torchify
      ), "You cannot specify both numpy and PyTorch tensors at the same time"
  
      if equal_resolution:
          image_inputs = []
          for i in range(self.batch_size):
              image_inputs.append(
                  np.random.randint(
                      255,
                      size=(
                          self.num_channels,
                          self.max_resolution,
                          self.max_resolution,
                      ),
                      dtype=np.uint8,
                  )
              )
      else:
          image_inputs = []
          for i in range(self.batch_size):
              width, height = np.random.choice(
                  np.arange(self.min_resolution, self.max_resolution), 2
              )
              image_inputs.append(
                  np.random.randint(
                      255,
                      size=(self.num_channels, width, height),
                      dtype=np.uint8,
                  )
              )
  
      if not numpify and not torchify:
          # PIL expects the channel dimension as last dimension
          image_inputs = [
              Image.fromarray(np.moveaxis(x, 0, -1))
              for x in image_inputs
          ]
  
      if torchify:
          image_inputs = [torch.from_numpy(x) for x in image_inputs]
  
      return image_inputs
  
imports: import unittest
  import numpy
  from transformers.testing_utils import require_torch, require_vision
  from transformers.utils import is_torch_available, is_vision_available
  from ...test_feature_extraction_common import FeatureExtractionSavingTestMixin
label_desc: Use image node_id 3 for calling the CLIPFeatureExtractionTester obj's underlying member method code with example usage: obj.prepare_inputs(equal_resolution, numpify, torchify) and returns: image_inputs