




"""simple docstring"""







from typing import Callable, Optional

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



class  _lowerCamelCase			(__lowerCAmelCase     ):







				def __init__( self    :       Dict			,					lowerCamelCase_    :       Callable			,					lowerCamelCase_    :       Optional[Features] = None			,					lowerCamelCase_    :       str = None			,					lowerCamelCase_    :       bool = False			,					lowerCamelCase_    :       bool = False			,					lowerCamelCase_    :       Optional[dict] = None			,					lowerCamelCase_    :       Optional[int] = None			,					**lowerCamelCase_    :       Dict			,					):

					"""simple docstring"""






					super().__init__(
					    features=lowerCamelCase__			,					cache_dir=lowerCamelCase__			,					keep_in_memory=lowerCamelCase__			,					streaming=lowerCamelCase__			,					num_proc=lowerCamelCase__			,					**lowerCamelCase__			,					)
					_lowercase :    Union[str, Any]							=							Generator(
					    cache_dir=lowerCamelCase__			,					features=lowerCamelCase__			,					generator=lowerCamelCase__			,					gen_kwargs=lowerCamelCase__			,					**lowerCamelCase__			,					)







				def 							__UpperCAmelCase					( self    :       Optional[int]						):

					"""simple docstring"""






					if self.streaming:
						_lowercase :    Union[str, Any]							=							self.builder.as_streaming_dataset(split='train'						)
					# Build regular (map-style) dataset
					else:
						_lowercase :    Union[str, Any]							=							None
						_lowercase :    str							=							None
						_lowercase :    Optional[Any]							=							None
						_lowercase :    int							=							None

						self.builder.download_and_prepare(
						    download_config=lowerCamelCase__			,					download_mode=lowerCamelCase__			,					verification_mode=lowerCamelCase__			,					base_path=lowerCamelCase__			,					num_proc=self.num_proc			,					)
						_lowercase :    List[str]							=							self.builder.as_dataset(
						    split='train'			,					verification_mode=lowerCamelCase__			,					in_memory=self.keep_in_memory						)
					return dataset




"""simple docstring"""







from typing import Any


def      __lowerCAmelCase(		__UpperCAmelCase			):






	"""simple docstring"""





	if not input_list:
		return []
	_lowercase :    List[str]							=							[input_list.count(__UpperCAmelCase			) for value in input_list]
	_lowercase :    Optional[int]							=							max(__UpperCAmelCase			)  # Gets the maximum count in the input list.
	# Gets values of modes
	return sorted({input_list[i] for i, value in enumerate(__UpperCAmelCase			) if value == y}			)


if __name__ == "__main__":
						import doctest

						doctest.testmod()



