code: '''simple docstring'''
  
  
  
  
  
  import unittest
  
  import numpy as np
  
  from transformers.testing_utils import require_torch, require_vision
  from transformers.utils import is_torch_available, is_vision_available
  
  from ...test_image_processing_common import ImageProcessingSavingTestMixin
  
  
  if is_torch_available():
       import torch
  
  if is_vision_available():
       from PIL import Image
  
       from transformers import SwinaSRImageProcessor
       from transformers.image_transforms import get_image_size
  
  
  
  
  
  
  
  class 					UpperCAmelCase_				(							unittest.TestCase    ):
  
  
  
  
      def __init__(					self  :   Optional[Any]      ,      lowerCAmelCase  :   Tuple      ,      lowerCAmelCase  :   int=7      ,      lowerCAmelCase  :   List[Any]=3      ,      lowerCAmelCase  :   Union[str, Any]=18      ,      lowerCAmelCase  :   Optional[Any]=30      ,      lowerCAmelCase  :   Dict=400      ,      lowerCAmelCase  :   int=True      ,      lowerCAmelCase  :   Tuple=1 / 255      ,      lowerCAmelCase  :   int=True      ,      lowerCAmelCase  :   Optional[Any]=8      ,      )	-> Any:
        a__     		=     parent
        a__     		=     batch_size
        a__     		=     num_channels
        a__     		=     image_size
        a__     		=     min_resolution
        a__     		=     max_resolution
        a__     		=     do_rescale
        a__     		=     rescale_factor
        a__     		=     do_pad
        a__     		=     pad_size
  
  
  
  
      def 						__lowerCamelCase (					self  :   Optional[Any]   )	-> Union[str, Any]:
        return {
            "do_rescale": self.do_rescale,
            "rescale_factor": self.rescale_factor,
            "do_pad": self.do_pad,
            "pad_size": self.pad_size,
        }
  
  
  
  
      def 						__lowerCamelCase (					self  :   int      ,      lowerCAmelCase  :   Any=False      ,      lowerCAmelCase  :   Optional[Any]=False      ,      lowerCAmelCase  :   Any=False   )	-> int:
        assert not (numpify and torchify), "You cannot specify both numpy and PyTorch tensors at the same time"
  
        if equal_resolution:
          a__     		=     []
          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.uinta   )   )
        else:
          a__     		=     []
          for i in range(self.batch_size   ):
            a__		,a__     		=     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.uinta   )   )
  
        if not numpify and not torchify:
          # PIL expects the channel dimension as last dimension
          a__     		=     [Image.fromarray(np.moveaxis(lowerCAmelCase      ,      0      ,      -1   )   ) for x in image_inputs]
  
        if torchify:
          a__     		=     [torch.from_numpy(lowerCAmelCase   ) for x in image_inputs]
  
        return image_inputs
  
  
  
  
  
  
  
  @require_torch
  @require_vision
  class 					UpperCAmelCase_				(							_a     ,     unittest.TestCase    ):
      UpperCAmelCase_			:       List[Any]						 =							SwinaSRImageProcessor if is_vision_available() else None
  
  
  
  
      def 						__lowerCamelCase (					self  :   Union[str, Any]   )	-> Any:
        a__     		=     SwinaSRImageProcessingTester(self   )
  
  
  
  
      @property
      def 						__lowerCamelCase (					self  :   str   )	-> List[str]:
        return self.image_processor_tester.prepare_image_processor_dict()
  
  
  
  
      def 						__lowerCamelCase (					self  :   Any   )	-> Optional[Any]:
        a__     		=     self.image_processing_class(**self.image_processor_dict   )
        self.assertTrue(hasattr(lowerCAmelCase      ,      "do_rescale"   )   )
        self.assertTrue(hasattr(lowerCAmelCase      ,      "rescale_factor"   )   )
        self.assertTrue(hasattr(lowerCAmelCase      ,      "do_pad"   )   )
        self.assertTrue(hasattr(lowerCAmelCase      ,      "pad_size"   )   )
  
  
  
  
      def 						__lowerCamelCase (					self  :   Union[str, Any]   )	-> List[Any]:
        pass
  
  
  
  
      def 						__lowerCamelCase (					self  :   Dict      ,      lowerCAmelCase  :   Tuple   )	-> Optional[int]:
        a__		,a__     		=     get_image_size(lowerCAmelCase   )
        a__     		=     self.image_processor_tester.pad_size
  
        a__     		=     (old_height // size + 1) * size - old_height
        a__     		=     (old_width // size + 1) * size - old_width
        return old_height + pad_height, old_width + pad_width
  
  
  
  
      def 						__lowerCamelCase (					self  :   int   )	-> Dict:
        # Initialize image_processor
        a__     		=     self.image_processing_class(**self.image_processor_dict   )
        # create random PIL images
        a__     		=     self.image_processor_tester.prepare_inputs(equal_resolution=lowerCAmelCase   )
        for image in image_inputs:
          self.assertIsInstance(lowerCAmelCase      ,      Image.Image   )
  
        # Test not batched input
        a__     		=     image_processor(image_inputs[0]      ,      return_tensors="pt"   ).pixel_values
        a__		,a__     		=     self.calculate_expected_size(np.array(image_inputs[0]   )   )
        self.assertEqual(
            encoded_images.shape      ,      (
                1,
                self.image_processor_tester.num_channels,
                expected_height,
                expected_width,
            )      ,      )
  
  
  
  
      def 						__lowerCamelCase (					self  :   Dict   )	-> int:
        # Initialize image_processor
        a__     		=     self.image_processing_class(**self.image_processor_dict   )
        # create random numpy tensors
        a__     		=     self.image_processor_tester.prepare_inputs(equal_resolution=lowerCAmelCase      ,      numpify=lowerCAmelCase   )
        for image in image_inputs:
          self.assertIsInstance(lowerCAmelCase      ,      np.ndarray   )
  
        # Test not batched input
        a__     		=     image_processor(image_inputs[0]      ,      return_tensors="pt"   ).pixel_values
        a__		,a__     		=     self.calculate_expected_size(image_inputs[0]   )
        self.assertEqual(
            encoded_images.shape      ,      (
                1,
                self.image_processor_tester.num_channels,
                expected_height,
                expected_width,
            )      ,      )
  
  
  
  
      def 						__lowerCamelCase (					self  :   Optional[Any]   )	-> List[str]:
        # Initialize image_processor
        a__     		=     self.image_processing_class(**self.image_processor_dict   )
        # create random PyTorch tensors
        a__     		=     self.image_processor_tester.prepare_inputs(equal_resolution=lowerCAmelCase      ,      torchify=lowerCAmelCase   )
        for image in image_inputs:
          self.assertIsInstance(lowerCAmelCase      ,      torch.Tensor   )
  
        # Test not batched input
        a__     		=     image_processor(image_inputs[0]      ,      return_tensors="pt"   ).pixel_values
        a__		,a__     		=     self.calculate_expected_size(image_inputs[0]   )
        self.assertEqual(
            encoded_images.shape      ,      (
                1,
                self.image_processor_tester.num_channels,
                expected_height,
                expected_width,
            )      ,      )
  
  
style_context: def 				__lowercase	(						lowerCamelCase__ ,				lowerCamelCase__					)				->Optional[int]:
  
    '''simple docstring'''
  
  
  
  
    sequence.append(lowerCamelCase__					)
  
    a__     		=     0
    while sequence[index] != target:
      index += 1
  
    sequence.pop()
  
    if index == len(lowerCamelCase__					):
      return None
  
    return index
  
  
  if __name__ == "__main__":
       _SCREAMING_SNAKE_CASE   						=    input("""Enter numbers separated by comma:\n""").strip()
       _SCREAMING_SNAKE_CASE   						=    [int(item) for item in user_input.split(""",""")]
  
       _SCREAMING_SNAKE_CASE   						=    input("""Enter a single number to be found in the list:\n""")
       _SCREAMING_SNAKE_CASE   						=    int(target_input)
       _SCREAMING_SNAKE_CASE   						=    sentinel_linear_search(sequence, target)
       if result is not None:
            print(F"""{target} found at positions: {result}""")
       else:
            print("""Not found""")
  
  