"""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_video_inputs


if is_torch_available():
						import torch

if is_vision_available():
						from PIL import Image

						from transformers import VideoMAEImageProcessor


class      _lowercase						(				unittest.TestCase					):

				def __init__(       self    :      Any    ,      _lowercase    :      Tuple    ,      _lowercase    :      Union[str, Any]=7    ,      _lowercase    :      Tuple=3    ,      _lowercase    :      Optional[int]=1_0    ,      _lowercase    :      Tuple=1_8    ,      _lowercase    :      List[str]=3_0    ,      _lowercase    :      List[str]=4_0_0    ,      _lowercase    :      Optional[int]=True    ,      _lowercase    :      Tuple=None    ,      _lowercase    :      List[Any]=True    ,      _lowercase    :      Any=[0.5, 0.5, 0.5]    ,      _lowercase    :      Any=[0.5, 0.5, 0.5]    ,      _lowercase    :      Tuple=None    ,      ):


										'''simple docstring'''
										UpperCAmelCase__   		=						size if size is not None else {"""shortest_edge""": 1_8}
										UpperCAmelCase__   		=						crop_size if crop_size is not None else {"""height""": 1_8, """width""": 1_8}

										UpperCAmelCase__   		=						parent
										UpperCAmelCase__   		=						batch_size
										UpperCAmelCase__   		=						num_channels
										UpperCAmelCase__   		=						num_frames
										UpperCAmelCase__   		=						image_size
										UpperCAmelCase__   		=						min_resolution
										UpperCAmelCase__   		=						max_resolution
										UpperCAmelCase__   		=						do_resize
										UpperCAmelCase__   		=						size
										UpperCAmelCase__   		=						do_normalize
										UpperCAmelCase__   		=						image_mean
										UpperCAmelCase__   		=						image_std
										UpperCAmelCase__   		=						crop_size

				def     A	(       self    :      List[str]       ):


										'''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,
										    "crop_size": self.crop_size,
										}


@require_torch
@require_vision
class      _lowercase						(				__lowerCamelCase , unittest.TestCase					):
				lowerCamelCase__									=    VideoMAEImageProcessor if is_vision_available() else None

				def     A	(       self    :      Union[str, Any]       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						VideoMAEImageProcessingTester(self       )

				@property
				def     A	(       self    :      Union[str, Any]       ):


										'''simple docstring'''
										return self.image_processor_tester.prepare_image_processor_dict()

				def     A	(       self    :      List[Any]       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						self.image_processing_class(**self.image_processor_dict       )
										self.assertTrue(hasattr(_lowercase    ,      """image_mean"""       )       )
										self.assertTrue(hasattr(_lowercase    ,      """image_std"""       )       )
										self.assertTrue(hasattr(_lowercase    ,      """do_normalize"""       )       )
										self.assertTrue(hasattr(_lowercase    ,      """do_resize"""       )       )
										self.assertTrue(hasattr(_lowercase    ,      """do_center_crop"""       )       )
										self.assertTrue(hasattr(_lowercase    ,      """size"""       )       )

				def     A	(       self    :      Union[str, Any]       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						self.image_processing_class.from_dict(self.image_processor_dict       )
										self.assertEqual(image_processor.size    ,      {"""shortest_edge""": 1_8}       )
										self.assertEqual(image_processor.crop_size    ,      {"""height""": 1_8, """width""": 1_8}       )

										UpperCAmelCase__   		=						self.image_processing_class.from_dict(self.image_processor_dict    ,      size=4_2    ,      crop_size=8_4       )
										self.assertEqual(image_processor.size    ,      {"""shortest_edge""": 4_2}       )
										self.assertEqual(image_processor.crop_size    ,      {"""height""": 8_4, """width""": 8_4}       )

				def     A	(       self    :      int       ):


										'''simple docstring'''
										pass

				def     A	(       self    :      str       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						self.image_processing_class(**self.image_processor_dict       )
										# create random PIL videos
										UpperCAmelCase__   		=						prepare_video_inputs(self.image_processor_tester    ,      equal_resolution=_lowercase       )
										for video in video_inputs:
																self.assertIsInstance(_lowercase    ,      _lowercase       )
																self.assertIsInstance(video[0]    ,      Image.Image       )

										# Test not batched input
										UpperCAmelCase__   		=						image_processing(video_inputs[0]    ,      return_tensors="""pt"""       ).pixel_values
										self.assertEqual(
										    encoded_videos.shape    ,      (
										        1,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size["""height"""],
										        self.image_processor_tester.crop_size["""width"""],
										    )    ,      )

										# Test batched
										UpperCAmelCase__   		=						image_processing(_lowercase    ,      return_tensors="""pt"""       ).pixel_values
										self.assertEqual(
										    encoded_videos.shape    ,      (
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size["""height"""],
										        self.image_processor_tester.crop_size["""width"""],
										    )    ,      )

				def     A	(       self    :      Tuple       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						self.image_processing_class(**self.image_processor_dict       )
										# create random numpy tensors
										UpperCAmelCase__   		=						prepare_video_inputs(self.image_processor_tester    ,      equal_resolution=_lowercase    ,      numpify=_lowercase       )
										for video in video_inputs:
																self.assertIsInstance(_lowercase    ,      _lowercase       )
																self.assertIsInstance(video[0]    ,      np.ndarray       )

										# Test not batched input
										UpperCAmelCase__   		=						image_processing(video_inputs[0]    ,      return_tensors="""pt"""       ).pixel_values
										self.assertEqual(
										    encoded_videos.shape    ,      (
										        1,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size["""height"""],
										        self.image_processor_tester.crop_size["""width"""],
										    )    ,      )

										# Test batched
										UpperCAmelCase__   		=						image_processing(_lowercase    ,      return_tensors="""pt"""       ).pixel_values
										self.assertEqual(
										    encoded_videos.shape    ,      (
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size["""height"""],
										        self.image_processor_tester.crop_size["""width"""],
										    )    ,      )

				def     A	(       self    :      Optional[int]       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						self.image_processing_class(**self.image_processor_dict       )
										# create random PyTorch tensors
										UpperCAmelCase__   		=						prepare_video_inputs(self.image_processor_tester    ,      equal_resolution=_lowercase    ,      torchify=_lowercase       )
										for video in video_inputs:
																self.assertIsInstance(_lowercase    ,      _lowercase       )
																self.assertIsInstance(video[0]    ,      torch.Tensor       )

										# Test not batched input
										UpperCAmelCase__   		=						image_processing(video_inputs[0]    ,      return_tensors="""pt"""       ).pixel_values
										self.assertEqual(
										    encoded_videos.shape    ,      (
										        1,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size["""height"""],
										        self.image_processor_tester.crop_size["""width"""],
										    )    ,      )

										# Test batched
										UpperCAmelCase__   		=						image_processing(_lowercase    ,      return_tensors="""pt"""       ).pixel_values
										self.assertEqual(
										    encoded_videos.shape    ,      (
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size["""height"""],
										        self.image_processor_tester.crop_size["""width"""],
										    )    ,      )


"""simple docstring"""







def 					a__ (						UpperCAmelCase__    :     List[Any]     )->		Dict:
						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(UpperCAmelCase__						,     len(UpperCAmelCase__     )     ):
																		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()
						UpperCamelCase_    :    Union[str, Any]											=						input("""Enter numbers separated by a comma:\n""").strip()
						UpperCamelCase_    :    int											=						[int(item) for item in user_input.split(""",""")]
						print(shell_sort(unsorted))

