




from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream




class       _A				(		__lowercase     ):






		def __init__(    self						,		_SCREAMING_SNAKE_CASE						,		_SCREAMING_SNAKE_CASE = None						,		_SCREAMING_SNAKE_CASE = None						,		_SCREAMING_SNAKE_CASE = False						,		_SCREAMING_SNAKE_CASE = False						,		_SCREAMING_SNAKE_CASE = None						,		_SCREAMING_SNAKE_CASE = None						,		**_SCREAMING_SNAKE_CASE						,		):
								super().__init__(
								    features=_SCREAMING_SNAKE_CASE						,		cache_dir=_SCREAMING_SNAKE_CASE						,		keep_in_memory=_SCREAMING_SNAKE_CASE						,		streaming=_SCREAMING_SNAKE_CASE						,		num_proc=_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE						,		)
								_UpperCAmelCase      =			Generator(
								    cache_dir=_SCREAMING_SNAKE_CASE						,		features=_SCREAMING_SNAKE_CASE						,		generator=_SCREAMING_SNAKE_CASE						,		gen_kwargs=_SCREAMING_SNAKE_CASE						,		**_SCREAMING_SNAKE_CASE						,		)






		def 				UpperCAmelCase (    self			):
								# Build iterable dataset
								if self.streaming:
														_UpperCAmelCase      =			self.builder.as_streaming_dataset(split="""train"""			)
								# Build regular (map-style) dataset
								else:
														_UpperCAmelCase      =			None
														_UpperCAmelCase      =			None
														_UpperCAmelCase      =			None
														_UpperCAmelCase      =			None

														self.builder.download_and_prepare(
														    download_config=_SCREAMING_SNAKE_CASE						,		download_mode=_SCREAMING_SNAKE_CASE						,		verification_mode=_SCREAMING_SNAKE_CASE						,		base_path=_SCREAMING_SNAKE_CASE						,		num_proc=self.num_proc						,		)
														_UpperCAmelCase      =			self.builder.as_dataset(
														    split="""train"""						,		verification_mode=_SCREAMING_SNAKE_CASE						,		in_memory=self.keep_in_memory			)
								return dataset





from __future__ import annotations




def        _SCREAMING_SNAKE_CASE      (		snake_case       )						->				list[int]:
						if len(snake_case       ) == 0:
												return array

						_UpperCAmelCase    ,					_UpperCAmelCase      =			min(snake_case       ), max(snake_case       )

						# Compute the variables
						_UpperCAmelCase      =			_max - _min + 1
						_UpperCAmelCase    ,					_UpperCAmelCase      =			[0] * holes_range, [0] * holes_range

						# Make the sorting.
						for i in array:
												_UpperCAmelCase      =			i - _min
												_UpperCAmelCase      =			i
												holes_repeat[index] += 1

						# Makes the array back by replacing the numbers.
						_UpperCAmelCase      =			0
						for i in range(snake_case       ):
												while holes_repeat[i] > 0:
																		_UpperCAmelCase      =			holes[i]
																		index += 1
																		holes_repeat[i] -= 1

    # Returns the sorted array.
						return array


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				a													=			input("Enter numbers separated by comma:\n")
				a													=			[int(x) for x in user_input.split(",")]
				print(pigeon_sort(unsorted))