




def      UpperCAmelCase  (						UpperCamelCase__   )     ->     list:







				'''simple docstring'''


				__lowerCAmelCase					=  len(__UpperCamelCase   )

				# Set the gap value to be decreased by a factor of 1.3
				# after each iteration
				__lowerCAmelCase					=  1.3

				# Continue sorting until the gap is 1
				while gap > 1:
								# Decrease the gap value
								__lowerCAmelCase					=  int(gap / shrink   )

								# Sort the elements using insertion sort
								for i in range(__UpperCamelCase						,			len(__UpperCamelCase   )   ):
												__lowerCAmelCase					=  collection[i]
												__lowerCAmelCase					=  i
												while j >= gap and collection[j - gap] > temp:
																__lowerCAmelCase					=  collection[j - gap]
																j -= gap
												__lowerCAmelCase					=  temp

				return collection


if __name__ == "__main__":
	import doctest

	doctest.testmod()







"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__A					=			{
    'configuration_donut_swin': ['DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DonutSwinConfig'],
    'processing_donut': ['DonutProcessor'],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__A					=			[
			    'DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'DonutSwinModel',
			    'DonutSwinPreTrainedModel',
			]

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__A					=			['DonutFeatureExtractor']
			__A					=			['DonutImageProcessor']


if TYPE_CHECKING:
			from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig
			from .processing_donut import DonutProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_donut_swin import (
						    DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
						    DonutSwinModel,
						    DonutSwinPreTrainedModel,
						)

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .feature_extraction_donut import DonutFeatureExtractor
						from .image_processing_donut import DonutImageProcessor

else:
			import sys

			__A					=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



