"""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			:       Union[str, Any]   ,						_lowercase			:       Dict   ,						_lowercase			:       List[str]=7   ,						_lowercase			:       int=3   ,						_lowercase			:       Optional[Any]=1_8   ,						_lowercase			:       int=3_0   ,						_lowercase			:       Union[str, Any]=4_0_0   ,						_lowercase			:       Dict=True   ,						_lowercase			:       Any=1 / 2_5_5   ,						_lowercase			:       Any=True   ,						_lowercase			:       Tuple=8   ,						)						->    List[Any]:
       _lowercase							     =       parent
       _lowercase							     =       batch_size
       _lowercase							     =       num_channels
       _lowercase							     =       image_size
       _lowercase							     =       min_resolution
       _lowercase							     =       max_resolution
       _lowercase							     =       do_rescale
       _lowercase							     =       rescale_factor
       _lowercase							     =       do_pad
       _lowercase							     =       pad_size
    def 		_lowerCamelCase      (	self			:       Dict		)						->    Optional[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			:       Optional[int]   ,						_lowercase			:       Union[str, Any]=False   ,						_lowercase			:       int=False   ,						_lowercase			:       Optional[int]=False		)						->    Optional[int]:
       assert not (numpify and torchify), "You cannot specify both numpy and PyTorch tensors at the same time"

       if equal_resolution:
          _lowercase							     =       []
          for i in range(self.batch_size		):
             image_inputs.append(
                 np.random.randint(
                     2_5_5   ,						size=(self.num_channels, self.max_resolution, self.max_resolution)   ,						dtype=np.uinta		)		)
       else:
          _lowercase							     =       []
          for i in range(self.batch_size		):
             _lowercase     ,  _lowercase							     =       np.random.choice(np.arange(self.min_resolution   ,						self.max_resolution		)   ,						2		)
             image_inputs.append(np.random.randint(2_5_5   ,						size=(self.num_channels, width, height)   ,						dtype=np.uinta		)		)

       if not numpify and not torchify:
          # PIL expects the channel dimension as last dimension
          _lowercase							     =       [Image.fromarray(np.moveaxis(_lowercase   ,						0   ,						-1		)		) for x in image_inputs]

       if torchify:
          _lowercase							     =       [torch.from_numpy(_lowercase		) for x in image_inputs]

       return image_inputs
@require_torch
@require_vision
class   UpperCAmelCase_	(				lowercase__,    unittest.TestCase   ):
    snake_case_											=      SwinaSRImageProcessor if is_vision_available() else None
    def 		_lowerCamelCase      (	self			:       Tuple		)						->    Union[str, Any]:
       _lowercase							     =       SwinaSRImageProcessingTester(self		)
    @property
    def 		_lowerCamelCase      (	self			:       List[Any]		)						->    Any:
       return self.image_processor_tester.prepare_image_processor_dict()
    def 		_lowerCamelCase      (	self			:       Optional[Any]		)						->    Optional[int]:
       _lowercase							     =       self.image_processing_class(**self.image_processor_dict		)
       self.assertTrue(hasattr(_lowercase   ,						"do_rescale"		)		)
       self.assertTrue(hasattr(_lowercase   ,						"rescale_factor"		)		)
       self.assertTrue(hasattr(_lowercase   ,						"do_pad"		)		)
       self.assertTrue(hasattr(_lowercase   ,						"pad_size"		)		)
    def 		_lowerCamelCase      (	self			:       List[Any]		)						->    List[Any]:
       pass
    def 		_lowerCamelCase      (	self			:       Any   ,						_lowercase			:       Union[str, Any]		)						->    List[str]:
       _lowercase     ,  _lowercase							     =       get_image_size(_lowercase		)
       _lowercase							     =       self.image_processor_tester.pad_size

       _lowercase							     =       (old_height // size + 1) * size - old_height
       _lowercase							     =       (old_width // size + 1) * size - old_width
       return old_height + pad_height, old_width + pad_width
    def 		_lowerCamelCase      (	self			:       int		)						->    Union[str, Any]:
       _lowercase							     =       self.image_processing_class(**self.image_processor_dict		)
       # create random PIL images
       _lowercase							     =       self.image_processor_tester.prepare_inputs(equal_resolution=_lowercase		)
       for image in image_inputs:
          self.assertIsInstance(_lowercase   ,						Image.Image		)

       # Test not batched input
       _lowercase							     =       image_processor(image_inputs[0]   ,						return_tensors="pt"		).pixel_values
       _lowercase     ,  _lowercase							     =       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			:       Tuple		)						->    Optional[Any]:
       _lowercase							     =       self.image_processing_class(**self.image_processor_dict		)
       # create random numpy tensors
       _lowercase							     =       self.image_processor_tester.prepare_inputs(equal_resolution=_lowercase   ,						numpify=_lowercase		)
       for image in image_inputs:
          self.assertIsInstance(_lowercase   ,						np.ndarray		)

       # Test not batched input
       _lowercase							     =       image_processor(image_inputs[0]   ,						return_tensors="pt"		).pixel_values
       _lowercase     ,  _lowercase							     =       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			:       Union[str, Any]		)						->    str:
       _lowercase							     =       self.image_processing_class(**self.image_processor_dict		)
       # create random PyTorch tensors
       _lowercase							     =       self.image_processor_tester.prepare_inputs(equal_resolution=_lowercase   ,						torchify=_lowercase		)
       for image in image_inputs:
          self.assertIsInstance(_lowercase   ,						torch.Tensor		)

       # Test not batched input
       _lowercase							     =       image_processor(image_inputs[0]   ,						return_tensors="pt"		).pixel_values
       _lowercase     ,  _lowercase							     =       self.calculate_expected_size(image_inputs[0]		)
       self.assertEqual(
           encoded_images.shape   ,						(
               1,
               self.image_processor_tester.num_channels,
               expected_height,
               expected_width,
           )   ,						)




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







			'''simple docstring'''
			_UpperCAmelCase									=  len(_UpperCAmelCase       )
			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									=  lst[j + 1]
												_UpperCAmelCase									=  lst[j]
												_UpperCAmelCase									=  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									=  lst[no_of_elements - 1 - j]
												_UpperCAmelCase									=  lst[no_of_elements - 2 - j]
												_UpperCAmelCase									=  temp
			return lst


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