





'''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 ViTImageProcessor






class 							__lowercase				(					unittest.TestCase  ):







	'''simple docstring'''

	def __init__(self   ,_lowerCamelCase   ,_lowerCamelCase=7   ,_lowerCamelCase=3   ,_lowerCamelCase=18   ,_lowerCamelCase=30   ,_lowerCamelCase=400   ,_lowerCamelCase=True   ,_lowerCamelCase=None   ,_lowerCamelCase=True   ,_lowerCamelCase=[0.5, 0.5, 0.5]   ,_lowerCamelCase=[0.5, 0.5, 0.5]   ,)							->							int:







				'''simple docstring'''





				__lowercase   =							size if size is not None else {"""height""": 18, """width""": 18}
				__lowercase   =							parent
				__lowercase   =							batch_size
				__lowercase   =							num_channels
				__lowercase   =							image_size
				__lowercase   =							min_resolution
				__lowercase   =							max_resolution
				__lowercase   =							do_resize
				__lowercase   =							size
				__lowercase   =							do_normalize
				__lowercase   =							image_mean
				__lowercase   =							image_std


	def   _UpperCAmelCase   (self       )							->							Optional[Any]:







				'''simple docstring'''





				return {
				    "image_mean": self.image_mean,
				    "image_std": self.image_std,
				    "do_normalize": self.do_normalize,
				    "do_resize": self.do_resize,
				    "size": self.size,
				}






@require_torch
@require_vision
class 							__lowercase				(					_A       ,					unittest.TestCase  ):







	'''simple docstring'''

	a			: str      =				ViTImageProcessor if is_vision_available() else None


	def   _UpperCAmelCase   (self       )							->							Any:







				'''simple docstring'''





				__lowercase   =							ViTImageProcessingTester(self       )


	@property
	def   _UpperCAmelCase   (self       )							->							int:







				'''simple docstring'''





				return self.image_processor_tester.prepare_image_processor_dict()


	def   _UpperCAmelCase   (self       )							->							List[Any]:







				'''simple docstring'''





				__lowercase   =							self.image_processing_class(**self.image_processor_dict       )
				self.assertTrue(hasattr(snake_case_   ,'''image_mean'''       )       )
				self.assertTrue(hasattr(snake_case_   ,'''image_std'''       )       )
				self.assertTrue(hasattr(snake_case_   ,'''do_normalize'''       )       )
				self.assertTrue(hasattr(snake_case_   ,'''do_resize'''       )       )
				self.assertTrue(hasattr(snake_case_   ,'''size'''       )       )


	def   _UpperCAmelCase   (self       )							->							Optional[Any]:







				'''simple docstring'''





				__lowercase   =							self.image_processing_class.from_dict(self.image_processor_dict       )
				self.assertEqual(image_processor.size   ,{'''height''': 18, '''width''': 18}       )

				__lowercase   =							self.image_processing_class.from_dict(self.image_processor_dict   ,size=42       )
				self.assertEqual(image_processor.size   ,{'''height''': 42, '''width''': 42}       )


	def   _UpperCAmelCase   (self       )							->							Dict:







				'''simple docstring'''





				pass


	def   _UpperCAmelCase   (self       )							->							Any:







				'''simple docstring'''





				__lowercase   =							self.image_processing_class(**self.image_processor_dict       )
				# create random PIL images
				__lowercase   =							prepare_image_inputs(self.image_processor_tester   ,equal_resolution=snake_case_       )
				for image in image_inputs:
							self.assertIsInstance(snake_case_   ,Image.Image       )

				# Test not batched input
				__lowercase   =							image_processing(image_inputs[0]   ,return_tensors='''pt'''       ).pixel_values
				self.assertEqual(
				    encoded_images.shape   ,(
				        1,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.size['''height'''],
				        self.image_processor_tester.size['''width'''],
				    )   ,)

				# Test batched
				__lowercase   =							image_processing(snake_case_   ,return_tensors='''pt'''       ).pixel_values
				self.assertEqual(
				    encoded_images.shape   ,(
				        self.image_processor_tester.batch_size,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.size['''height'''],
				        self.image_processor_tester.size['''width'''],
				    )   ,)


	def   _UpperCAmelCase   (self       )							->							List[str]:







				'''simple docstring'''





				__lowercase   =							self.image_processing_class(**self.image_processor_dict       )
				# create random numpy tensors
				__lowercase   =							prepare_image_inputs(self.image_processor_tester   ,equal_resolution=snake_case_   ,numpify=snake_case_       )
				for image in image_inputs:
							self.assertIsInstance(snake_case_   ,np.ndarray       )

				# Test not batched input
				__lowercase   =							image_processing(image_inputs[0]   ,return_tensors='''pt'''       ).pixel_values
				self.assertEqual(
				    encoded_images.shape   ,(
				        1,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.size['''height'''],
				        self.image_processor_tester.size['''width'''],
				    )   ,)

				# Test batched
				__lowercase   =							image_processing(snake_case_   ,return_tensors='''pt'''       ).pixel_values
				self.assertEqual(
				    encoded_images.shape   ,(
				        self.image_processor_tester.batch_size,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.size['''height'''],
				        self.image_processor_tester.size['''width'''],
				    )   ,)


	def   _UpperCAmelCase   (self       )							->							Optional[Any]:







				'''simple docstring'''





				__lowercase   =							self.image_processing_class(**self.image_processor_dict       )
				# create random PyTorch tensors
				__lowercase   =							prepare_image_inputs(self.image_processor_tester   ,equal_resolution=snake_case_   ,torchify=snake_case_       )
				for image in image_inputs:
							self.assertIsInstance(snake_case_   ,torch.Tensor       )

				# Test not batched input
				__lowercase   =							image_processing(image_inputs[0]   ,return_tensors='''pt'''       ).pixel_values
				self.assertEqual(
				    encoded_images.shape   ,(
				        1,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.size['''height'''],
				        self.image_processor_tester.size['''width'''],
				    )   ,)

				# Test batched
				__lowercase   =							image_processing(snake_case_   ,return_tensors='''pt'''       ).pixel_values
				self.assertEqual(
				    encoded_images.shape   ,(
				        self.image_processor_tester.batch_size,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.size['''height'''],
				        self.image_processor_tester.size['''width'''],
				    )   ,)







def 				A__    (  lowerCamelCase  )     ->		Optional[Any]:
				UpperCamelCase_:							Optional[int]		=  len(lowerCamelCase  )
				for _ in range(
				    0   ,			int(((no_of_elements - 1) / 2) + 1  )  ):  # we don't need to traverse to end of list as
								for j in range(0   ,			no_of_elements - 1  ):
												if (
												    lst[j + 1] < lst[j]
												):  # applying bubble sort algorithm from left to right (or forwards)
																UpperCamelCase_:							str		=  lst[j + 1]
																UpperCamelCase_:							Tuple		=  lst[j]
																UpperCamelCase_:							str		=  temp
												if (
												    lst[no_of_elements - 1 - j] < lst[no_of_elements - 2 - j]
												):  # applying bubble sort algorithm from right to left (or backwards)
																UpperCamelCase_:							Union[str, Any]		=  lst[no_of_elements - 1 - j]
																UpperCamelCase_:							Dict		=  lst[no_of_elements - 2 - j]
																UpperCamelCase_:							List[Any]		=  temp
				return lst


if __name__ == "__main__":
							print("""enter the list to be sorted""")
							lowerCamelCase_  :       Union[str, Any]					      =     [int(x) for x in input().split()]  # inputing elements of the list in one line
							lowerCamelCase_  :       Union[str, Any]					      =     double_sort(lst)
							print("""the sorted list is""")
							print(sorted_lst)






