



'''simple docstring'''
from __future__ import annotations



def        __A   (							_SCREAMING_SNAKE_CASE     :  list	):







					"""simple docstring"""






					if len(UpperCamelCase_	) == 0:
										return []
					__SCREAMING_SNAKE_CASE				:    Union[str, Any]						    =							min(UpperCamelCase_	), max(UpperCamelCase_	)
					__SCREAMING_SNAKE_CASE				:    int						    =							int(max_value - min_value	) + 1
					__SCREAMING_SNAKE_CASE				:    list[list]						    =							[[] for _ in range(UpperCamelCase_	)]

					for i in my_list:
										buckets[int(i - min_value	)].append(UpperCamelCase_	)

					return [v for bucket in buckets for v in sorted(UpperCamelCase_	)]


if __name__ == "__main__":
					from doctest import testmod

					testmod()
					assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
					assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]






'''simple docstring'''





import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict


@pytest.mark.parametrize(
    '''split_dict''',   [
        SplitDict(),
        SplitDict({'''train''': SplitInfo(name='''train''',   num_bytes=1_337,   num_examples=42,   dataset_name='''my_dataset'''						)}						),
        SplitDict({'''train''': SplitInfo(name='''train''',   num_bytes=1_337,   num_examples=42						)}						),
        SplitDict({'''train''': SplitInfo()}						),
    ],   )
def        a__     (					UpperCamelCase_						:      SplitDict						):
   UpperCAmelCase__	:List[Any]      =      split_dict._to_yaml_list()
   assert len(UpperCamelCase_						) == len(UpperCamelCase_						)
   UpperCAmelCase__	:Tuple      =      SplitDict._from_yaml_list(UpperCamelCase_						)
   for split_name, split_info in split_dict.items():
      # dataset_name field is deprecated, and is therefore not part of the YAML dump
      UpperCAmelCase__	:Union[str, Any]      =      None
      # the split name of split_dict takes over the name of the split info object
      UpperCAmelCase__	:Union[str, Any]      =      split_name
   assert split_dict == reloaded


@pytest.mark.parametrize(
    '''split_info''',   [SplitInfo(), SplitInfo(dataset_name=UpperCamelCase_						), SplitInfo(dataset_name='''my_dataset'''						)]						)
def        a__     (					UpperCamelCase_						:      List[Any]						):
   # For backward compatibility, we need asdict(split_dict) to return split info dictrionaries with the "dataset_name"
   # field even if it's deprecated. This way old versionso of `datasets` can still reload dataset_infos.json files
   UpperCAmelCase__	:List[Any]      =      asdict(SplitDict({'''train''': split_info}						)						)
   assert "dataset_name" in split_dict_asdict["train"]
   assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name



