





'''simple docstring'''


import timeit

import numpy as np

import datasets
from datasets.arrow_writer import ArrowWriter
from datasets.features.features import _ArrayXD
def 							UpperCAmelCase_  (						__lowerCamelCase : int			):
			def wrapper(*__lowerCamelCase : str     ,**__lowerCamelCase : Any			):
						lowercase_      :Union[str, Any]         =			timeit.default_timer()
						lowercase_      :Tuple         =			func(*__lowerCamelCase     ,**__lowerCamelCase			)
						lowercase_      :Dict         =			timeit.default_timer() - starttime
						return delta

			lowercase_      :Optional[int]         =			func.__name__

			return wrapper
def 							UpperCAmelCase_  (						__lowerCamelCase : dict     ,__lowerCamelCase : Optional[Any]=1_00     ,__lowerCamelCase : Any=None			):
			lowercase_      :Optional[int]         =			[]
			lowercase_      :Dict         =			seq_shapes or {}
			for i in range(__lowerCamelCase			):
						lowercase_      :Tuple         =			{}
						for col_id, (k, v) in enumerate(features.items()			):
									if isinstance(__lowerCamelCase     ,_ArrayXD			):
												lowercase_      :List[Any]         =			np.random.rand(*v.shape			).astype(v.dtype			)
									elif isinstance(__lowerCamelCase     ,datasets.Value			):
												if v.dtype == "string":
															lowercase_      :Tuple         =			"The small grey turtle was surprisingly fast when challenged."
												else:
															lowercase_      :List[str]         =			np.random.randint(10     ,size=1			).astype(v.dtype			).item()
									elif isinstance(__lowerCamelCase     ,datasets.Sequence			):
												while isinstance(__lowerCamelCase     ,datasets.Sequence			):
															lowercase_      :Optional[int]         =			v.feature
												lowercase_      :Tuple         =			seq_shapes[k]
												lowercase_      :List[Any]         =			np.random.rand(*__lowerCamelCase			).astype(v.dtype			)
									lowercase_      :Dict         =			data

						dummy_data.append((i, example)			)

			return dummy_data


def 							UpperCAmelCase_  (						__lowerCamelCase : Optional[Any]     ,__lowerCamelCase : List[Any]     ,__lowerCamelCase : List[str]=1_00     ,__lowerCamelCase : Dict=None			):
			lowercase_      :List[str]         =			generate_examples(__lowerCamelCase     ,num_examples=__lowerCamelCase     ,seq_shapes=__lowerCamelCase			)

			with ArrowWriter(features=__lowerCamelCase     ,path=__lowerCamelCase			) as writer:
						for key, record in dummy_data:
									lowercase_      :Optional[int]         =			features.encode_example(__lowerCamelCase			)
									writer.write(__lowerCamelCase			)

						lowercase_      :Union[str, Any]         =			writer.finalize()

			if not num_final_examples == num_examples:
						raise ValueError(
						    F'Error writing the dataset, wrote {num_final_examples} examples but should have written {num_examples}.'			)

			lowercase_      :Dict         =			datasets.Dataset.from_file(filename=__lowerCamelCase     ,info=datasets.DatasetInfo(features=__lowerCamelCase			)			)

			return dataset









'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase : list			):
   if len(__lowerCamelCase			) <= 1:
      return lst

   lowercase_      :Optional[Any]         =			1

   while i < len(__lowerCamelCase			):
      if lst[i - 1] <= lst[i]:
         i += 1
      else:
         lowercase_      ,							lowercase_      :int         =			lst[i], lst[i - 1]
         i -= 1
         if i == 0:
            lowercase_      :Dict         =			1

   return lst


if __name__ == "__main__":
 lowerCAmelCase :					Any 							=input('''Enter numbers separated by a comma:\n''').strip()
 lowerCAmelCase :					List[str] 							=[int(item) for item in user_input.split(''',''')]
 print(gnome_sort(unsorted))


