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, prepare_image_inputs
  
  
  if is_torch_available():
    import torch
  
  if is_vision_available():
    from PIL import Image
  
    from transformers import ViltImageProcessor
  class 							_UpperCAmelCase							(				unittest.TestCase   ):
  
  
  
  
  
       '''simple docstring'''
  
  
  
       def __init__(      self ,			A ,			A=7 ,			A=3 ,			A=1_8 ,			A=3_0 ,			A=4_0_0 ,			A=True ,			A=None ,			A=2 ,			A=True ,			A=[0.5, 0.5, 0.5] ,			A=[0.5, 0.5, 0.5] ,			)							->      Any:
           _UpperCAmelCase							:						List[str]       							=					size if size is not None else {'''shortest_edge''': 3_0}
           _UpperCAmelCase							:						Optional[int]       							=					parent
           _UpperCAmelCase							:						List[str]       							=					batch_size
           _UpperCAmelCase							:						int       							=					num_channels
           _UpperCAmelCase							:						int       							=					image_size
           _UpperCAmelCase							:						Any       							=					min_resolution
           _UpperCAmelCase							:						int       							=					max_resolution
           _UpperCAmelCase							:						str       							=					do_resize
           _UpperCAmelCase							:						str       							=					size
           _UpperCAmelCase							:						Optional[int]       							=					size_divisor
           _UpperCAmelCase							:						Union[str, Any]       							=					do_normalize
           _UpperCAmelCase							:						Any       							=					image_mean
           _UpperCAmelCase							:						List[Any]       							=					image_std
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      Optional[Any]:
           return {
               "image_mean": self.image_mean,
               "image_std": self.image_std,
               "do_normalize": self.do_normalize,
               "do_resize": self.do_resize,
               "size": self.size,
               "size_divisor": self.size_divisor,
           }
  
  
  
  
  
       def 				__lowerCAmelCase			(      self ,			A ,			A=False	)							->      List[str]:
           if not batched:
               _UpperCAmelCase							:						Any       							=					self.size['''shortest_edge''']
               _UpperCAmelCase							:						int       							=					image_inputs[0]
               if isinstance(A ,			Image.Image	):
                   _UpperCAmelCase							,       _UpperCAmelCase							:						List[str]       							=					image.size
               else:
                   _UpperCAmelCase							,       _UpperCAmelCase							:						Optional[Any]       							=					image.shape[1], image.shape[2]
               _UpperCAmelCase							:						str       							=					size / min(A ,			A	)
               if h < w:
                   _UpperCAmelCase							,       _UpperCAmelCase							:						Optional[int]       							=					size, scale * w
               else:
                   _UpperCAmelCase							,       _UpperCAmelCase							:						List[Any]       							=					scale * h, size
  
               _UpperCAmelCase							:						Tuple       							=					int((1_3_3_3 / 8_0_0) * size	)
               if max(A ,			A	) > max_size:
                   _UpperCAmelCase							:						List[str]       							=					max_size / max(A ,			A	)
                   _UpperCAmelCase							:						Dict       							=					newh * scale
                   _UpperCAmelCase							:						Optional[int]       							=					neww * scale
  
               _UpperCAmelCase							,       _UpperCAmelCase							:						str       							=					int(newh + 0.5	), int(neww + 0.5	)
               _UpperCAmelCase							,       _UpperCAmelCase							:						List[str]       							=					(
                   newh // self.size_divisor * self.size_divisor,
                   neww // self.size_divisor * self.size_divisor,
               )
  
           else:
               _UpperCAmelCase							:						List[Any]       							=					[]
               for image in image_inputs:
                   _UpperCAmelCase							,       _UpperCAmelCase							:						Optional[int]       							=					self.get_expected_values([image]	)
                   expected_values.append((expected_height, expected_width)	)
               _UpperCAmelCase							:						Optional[Any]       							=					max(A ,			key=lambda A	: item[0]	)[0]
               _UpperCAmelCase							:						Dict       							=					max(A ,			key=lambda A	: item[1]	)[1]
  
           return expected_height, expected_width
  
  
  
  @require_torch
  @require_vision
  class 							_UpperCAmelCase							(				a	,unittest.TestCase   ):
  
  
  
  
  
       '''simple docstring'''
  
  
  
       a__             =ViltImageProcessor if is_vision_available() else None
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      Dict:
           _UpperCAmelCase							:						int       							=					ViltImageProcessingTester(self	)
  
  
  
  
  
       @property
       def 				__lowerCAmelCase			(      self	)							->      List[str]:
           return self.image_processor_tester.prepare_image_processor_dict()
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      str:
           _UpperCAmelCase							:						Optional[Any]       							=					self.image_processing_class(**self.image_processor_dict	)
           self.assertTrue(hasattr(A ,			'''image_mean'''	)	)
           self.assertTrue(hasattr(A ,			'''image_std'''	)	)
           self.assertTrue(hasattr(A ,			'''do_normalize'''	)	)
           self.assertTrue(hasattr(A ,			'''do_resize'''	)	)
           self.assertTrue(hasattr(A ,			'''size'''	)	)
           self.assertTrue(hasattr(A ,			'''size_divisor'''	)	)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      int:
           _UpperCAmelCase							:						List[str]       							=					self.image_processing_class.from_dict(self.image_processor_dict	)
           self.assertEqual(image_processor.size ,			{'''shortest_edge''': 3_0}	)
  
           _UpperCAmelCase							:						List[str]       							=					self.image_processing_class.from_dict(self.image_processor_dict ,			size=4_2	)
           self.assertEqual(image_processor.size ,			{'''shortest_edge''': 4_2}	)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      int:
           pass
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      Dict:
           # Initialize image_processing
           _UpperCAmelCase							:						str       							=					self.image_processing_class(**self.image_processor_dict	)
           # create random PIL images
           _UpperCAmelCase							:						Optional[int]       							=					prepare_image_inputs(self.image_processor_tester ,			equal_resolution=A	)
           for image in image_inputs:
               self.assertIsInstance(A ,			Image.Image	)
  
           # Test not batched input
           _UpperCAmelCase							:						int       							=					image_processing(image_inputs[0] ,			return_tensors='''pt'''	).pixel_values
  
           _UpperCAmelCase							,       _UpperCAmelCase							:						Union[str, Any]       							=					self.image_processor_tester.get_expected_values(A	)
           self.assertEqual(
               encoded_images.shape ,			(1, self.image_processor_tester.num_channels, expected_height, expected_width) ,			)
  
           # Test batched
           _UpperCAmelCase							:						int       							=					image_processing(A ,			return_tensors='''pt'''	).pixel_values
  
           _UpperCAmelCase							,       _UpperCAmelCase							:						Optional[int]       							=					self.image_processor_tester.get_expected_values(A ,			batched=A	)
           self.assertEqual(
               encoded_images.shape ,			(
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   expected_height,
                   expected_width,
               ) ,			)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      int:
           # Initialize image_processing
           _UpperCAmelCase							:						List[Any]       							=					self.image_processing_class(**self.image_processor_dict	)
           # create random numpy tensors
           _UpperCAmelCase							:						List[Any]       							=					prepare_image_inputs(self.image_processor_tester ,			equal_resolution=A ,			numpify=A	)
           for image in image_inputs:
               self.assertIsInstance(A ,			np.ndarray	)
  
           # Test not batched input
           _UpperCAmelCase							:						List[Any]       							=					image_processing(image_inputs[0] ,			return_tensors='''pt'''	).pixel_values
  
           _UpperCAmelCase							,       _UpperCAmelCase							:						int       							=					self.image_processor_tester.get_expected_values(A	)
           self.assertEqual(
               encoded_images.shape ,			(1, self.image_processor_tester.num_channels, expected_height, expected_width) ,			)
  
           # Test batched
           _UpperCAmelCase							:						List[Any]       							=					image_processing(A ,			return_tensors='''pt'''	).pixel_values
  
           _UpperCAmelCase							,       _UpperCAmelCase							:						Optional[int]       							=					self.image_processor_tester.get_expected_values(A ,			batched=A	)
           self.assertEqual(
               encoded_images.shape ,			(
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   expected_height,
                   expected_width,
               ) ,			)
  
  
  
  
  
       def 				__lowerCAmelCase			(      self	)							->      Dict:
           # Initialize image_processing
           _UpperCAmelCase							:						List[str]       							=					self.image_processing_class(**self.image_processor_dict	)
           # create random PyTorch tensors
           _UpperCAmelCase							:						Dict       							=					prepare_image_inputs(self.image_processor_tester ,			equal_resolution=A ,			torchify=A	)
           for image in image_inputs:
               self.assertIsInstance(A ,			torch.Tensor	)
  
           # Test not batched input
           _UpperCAmelCase							:						Any       							=					image_processing(image_inputs[0] ,			return_tensors='''pt'''	).pixel_values
  
           _UpperCAmelCase							,       _UpperCAmelCase							:						List[Any]       							=					self.image_processor_tester.get_expected_values(A	)
           self.assertEqual(
               encoded_images.shape ,			(1, self.image_processor_tester.num_channels, expected_height, expected_width) ,			)
  
           # Test batched
           _UpperCAmelCase							:						Optional[Any]       							=					image_processing(A ,			return_tensors='''pt'''	).pixel_values
  
           _UpperCAmelCase							,       _UpperCAmelCase							:						Tuple       							=					self.image_processor_tester.get_expected_values(A ,			batched=A	)
           self.assertEqual(
               encoded_images.shape ,			(
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   expected_height,
                   expected_width,
               ) ,			)
  
  
  
style_context: 
  
  
  
  """simple docstring"""
  def 				lowerCamelCase_		(UpperCamelCase__	:	List[Any]  , UpperCamelCase__	:	int							):
      sequence.append(UpperCamelCase__							)
  
      _UpperCAmelCase							:						str       							=					0
      while sequence[index] != target:
          index += 1
  
      sequence.pop()
  
      if index == len(UpperCamelCase__							):
          return None
  
      return index
  
  
  if __name__ == "__main__":
    _lowerCAmelCase					:Dict  =      input('Enter numbers separated by comma:\n').strip()
    _lowerCAmelCase					:List[Any]  =      [int(item) for item in user_input.split(',')]
  
    _lowerCAmelCase					:int  =      input('Enter a single number to be found in the list:\n')
    _lowerCAmelCase					:List[Any]  =      int(target_input)
    _lowerCAmelCase					:Optional[int]  =      sentinel_linear_search(sequence, target)
    if result is not None:
      print(f"{target} found at positions: {result}")
    else:
      print('Not found')
  
  
  