




from collections import OrderedDict
from dataclasses import fields
from typing import Any, Tuple

import numpy as np

from .import_utils import is_torch_available




def   _UpperCamelCase   (			snake_case__							)						->   Union[str, Any]:
							if is_torch_available():
														import torch

														if isinstance(lowercase_,    torch.Tensor							):
																					return True

							return isinstance(lowercase_,    np.ndarray							)







class 					_snake_case						(						__UpperCAmelCase				):
					def    _lowerCamelCase (  self:				List[str]     )    ->				Any:
												__UpperCAmelCase						:			Dict         =   fields(self     )

												# Safety and consistency checks
												if not len(lowercase_     ):
																			raise ValueError(f'''{self.__class__.__name__} has no fields.'''     )

												__UpperCAmelCase						:			Tuple         =   getattr(self	,  class_fields[0].name     )
												__UpperCAmelCase						:			Optional[Any]         =   all(getattr(self	,  field.name     ) is None for field in class_fields[1:]     )

												if other_fields_are_none and isinstance(lowercase_	,  lowercase_     ):
																			for key, value in first_field.items():
																										__UpperCAmelCase						:			Union[str, Any]         =   value
												else:
																			for field in class_fields:
																										__UpperCAmelCase						:			Tuple         =   getattr(self	,  field.name     )
																										if v is not None:
																																	__UpperCAmelCase						:			List[Any]         =   v
					def __delitem__(  self:				List[Any]	,  *__lowerCamelCase:				Optional[int]	,  **__lowerCamelCase:				int     )    ->				Union[str, Any]:
												raise Exception(f'''You cannot use ``__delitem__`` on a {self.__class__.__name__} instance.'''     )
					def    _lowerCamelCase (  self:				Optional[Any]	,  *__lowerCamelCase:				Dict	,  **__lowerCamelCase:				Union[str, Any]     )    ->				Union[str, Any]:
												raise Exception(f'''You cannot use ``setdefault`` on a {self.__class__.__name__} instance.'''     )
					def    _lowerCamelCase (  self:				Any	,  *__lowerCamelCase:				Tuple	,  **__lowerCamelCase:				Any     )    ->				int:
												raise Exception(f'''You cannot use ``pop`` on a {self.__class__.__name__} instance.'''     )
					def    _lowerCamelCase (  self:				Any	,  *__lowerCamelCase:				Dict	,  **__lowerCamelCase:				int     )    ->				List[Any]:
												raise Exception(f'''You cannot use ``update`` on a {self.__class__.__name__} instance.'''     )
					def __getitem__(  self:				List[Any]	,  __lowerCamelCase:				Union[str, Any]     )    ->				Optional[int]:

												if isinstance(lowercase_	,  lowercase_     ):
																			__UpperCAmelCase						:			List[str]         =   dict(self.items()     )
																			return inner_dict[k]
												else:
																			return self.to_tuple()[k]
					def __setattr__(  self:				Optional[int]	,  __lowerCamelCase:				Optional[Any]	,  __lowerCamelCase:				List[Any]     )    ->				Union[str, Any]:

												if name in self.keys() and value is not None:
																			# Don't call self.__setitem__ to avoid recursion errors
																			super().__setitem__(lowercase_	,  lowercase_     )
												super().__setattr__(lowercase_	,  lowercase_     )
					def __setitem__(  self:				Any	,  __lowerCamelCase:				Optional[int]	,  __lowerCamelCase:				Tuple     )    ->				Union[str, Any]:
												super().__setitem__(lowercase_	,  lowercase_     )
												# Don't call self.__setattr__ to avoid recursion errors
												super().__setattr__(lowercase_	,  lowercase_     )





					def    _lowerCamelCase (  self:				Tuple     )    ->				Tuple[Any]:
												return tuple(self[k] for k in self.keys()     )





def   _UpperCamelCase   (			snake_case__							)						->   list:
							__UpperCAmelCase						:			Optional[int]         =   1.3
							__UpperCAmelCase						:			Any         =   len(snake_case__							)
							__UpperCAmelCase						:			Optional[Any]         =   False

							while not completed:
														# Update the gap value for a next comb
														__UpperCAmelCase						:			List[str]         =   int(gap / shrink_factor							)
														if gap <= 1:
																					__UpperCAmelCase						:			Dict         =   True

														__UpperCAmelCase						:			List[Any]         =   0
														while index + gap < len(snake_case__							):
																					if data[index] > data[index + gap]:
																												# Swap values
																												__UpperCAmelCase    ,	__UpperCAmelCase						:			Tuple         =   data[index + gap], data[index]
																												__UpperCAmelCase						:			List[str]         =   False
																					index += 1

							return data


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	_snake_case			=						input('''Enter numbers separated by a comma:\n''').strip()
	_snake_case			=						[int(item) for item in user_input.split(''',''')]
	print(comb_sort(unsorted))




