code: 
  
  
  
  
  
  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    ,      __lowerCAmelCase    ,      __lowerCAmelCase=7    ,      __lowerCAmelCase=3    ,      __lowerCAmelCase=18    ,      __lowerCAmelCase=30    ,      __lowerCAmelCase=400    ,      __lowerCAmelCase=True    ,      __lowerCAmelCase=1 / 255    ,      __lowerCAmelCase=True    ,      __lowerCAmelCase=8    ,      )						->  int:
  							UpperCamelCase__         =	parent
  							UpperCamelCase__         =	batch_size
  							UpperCamelCase__         =	num_channels
  							UpperCamelCase__         =	image_size
  							UpperCamelCase__         =	min_resolution
  							UpperCamelCase__         =	max_resolution
  							UpperCamelCase__         =	do_rescale
  							UpperCamelCase__         =	rescale_factor
  							UpperCamelCase__         =	do_pad
  							UpperCamelCase__         =	pad_size
  
  
  
  
  					def 	snake_case_		(						self       )						->  Tuple:
  							return {
  							    "do_rescale": self.do_rescale,
  							    "rescale_factor": self.rescale_factor,
  							    "do_pad": self.do_pad,
  							    "pad_size": self.pad_size,
  							}
  
  
  
  
  					def 	snake_case_		(						self    ,      __lowerCAmelCase=False    ,      __lowerCAmelCase=False    ,      __lowerCAmelCase=False       )						->  str:
  							assert not (numpify and torchify), "You cannot specify both numpy and PyTorch tensors at the same time"
  
  							if equal_resolution:
  									UpperCamelCase__         =	[]
  									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:
  									UpperCamelCase__         =	[]
  									for i in range(self.batch_size       ):
  											UpperCamelCase__  ,			UpperCamelCase__         =	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
  									UpperCamelCase__         =	[Image.fromarray(np.moveaxis(__lowerCAmelCase    ,      0    ,      -1       )       ) for x in image_inputs]
  
  							if torchify:
  									UpperCamelCase__         =	[torch.from_numpy(__lowerCAmelCase       ) for x in image_inputs]
  
  							return image_inputs
  
  
  
  
  @require_torch
  @require_vision
  class   _UpperCAmelCase	(   _lowercase ,       unittest.TestCase					):
  					__A          =   SwinaSRImageProcessor if is_vision_available() else None
  
  
  
  
  					def 	snake_case_		(						self       )						->  int:
  							UpperCamelCase__         =	SwinaSRImageProcessingTester(self       )
  
  
  
  
  					@property
  					def 	snake_case_		(						self       )						->  List[Any]:
  							return self.image_processor_tester.prepare_image_processor_dict()
  
  
  
  
  					def 	snake_case_		(						self       )						->  Tuple:
  							UpperCamelCase__         =	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 	snake_case_		(						self       )						->  Any:
  							pass
  
  
  
  
  					def 	snake_case_		(						self    ,      __lowerCAmelCase       )						->  Any:
  							UpperCamelCase__  ,			UpperCamelCase__         =	get_image_size(__lowerCAmelCase       )
  							UpperCamelCase__         =	self.image_processor_tester.pad_size
  
  							UpperCamelCase__         =	(old_height // size + 1) * size - old_height
  							UpperCamelCase__         =	(old_width // size + 1) * size - old_width
  							return old_height + pad_height, old_width + pad_width
  
  
  
  
  					def 	snake_case_		(						self       )						->  Optional[Any]:
  							# Initialize image_processor
  							UpperCamelCase__         =	self.image_processing_class(**self.image_processor_dict       )
  							# create random PIL images
  							UpperCamelCase__         =	self.image_processor_tester.prepare_inputs(equal_resolution=__lowerCAmelCase       )
  							for image in image_inputs:
  									self.assertIsInstance(__lowerCAmelCase    ,      Image.Image       )
  
  							# Test not batched input
  							UpperCamelCase__         =	image_processor(image_inputs[0]    ,      return_tensors="""pt"""       ).pixel_values
  							UpperCamelCase__  ,			UpperCamelCase__         =	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 	snake_case_		(						self       )						->  List[str]:
  							# Initialize image_processor
  							UpperCamelCase__         =	self.image_processing_class(**self.image_processor_dict       )
  							# create random numpy tensors
  							UpperCamelCase__         =	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
  							UpperCamelCase__         =	image_processor(image_inputs[0]    ,      return_tensors="""pt"""       ).pixel_values
  							UpperCamelCase__  ,			UpperCamelCase__         =	self.calculate_expected_size(image_inputs[0]       )
  							self.assertEqual(
  							    encoded_images.shape    ,      (
  							        1,
  							        self.image_processor_tester.num_channels,
  							        expected_height,
  							        expected_width,
  							    )    ,      )
  
  
  
  
  					def 	snake_case_		(						self       )						->  Optional[int]:
  							# Initialize image_processor
  							UpperCamelCase__         =	self.image_processing_class(**self.image_processor_dict       )
  							# create random PyTorch tensors
  							UpperCamelCase__         =	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
  							UpperCamelCase__         =	image_processor(image_inputs[0]    ,      return_tensors="""pt"""       ).pixel_values
  							UpperCamelCase__  ,			UpperCamelCase__         =	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     a						(      _lowercase   :     List[str]       )     ->List[str]:
  		UpperCamelCase__         =	[7_0_1, 3_0_1, 1_3_2, 5_7, 2_3, 1_0, 4, 1]
  		for gap in gaps:
  				for i in range(_lowercase ,						len(_lowercase       )       ):
  						UpperCamelCase__         =	collection[i]
  						UpperCamelCase__         =	i
  						while j >= gap and collection[j - gap] > insert_value:
  								UpperCamelCase__         =	collection[j - gap]
  								j -= gap
  						if j != i:
  								UpperCamelCase__         =	insert_value
  		return collection
  
  
  if __name__ == "__main__":
  				from doctest import testmod
  
  				testmod()
  				__lowerCAmelCase     =			input("Enter numbers separated by a comma:\n").strip()
  				__lowerCAmelCase     =			[int(item) for item in user_input.split(",")]
  				print(shell_sort(unsorted))
  
  
  
  
  
  