






"""simple docstring"""
import pytest

import datasets.config
from datasets.utils.info_utils import is_small_dataset






@pytest.mark.parametrize("""dataset_size""" , [None, 400 * 2**20, 600 * 2**20]       )
@pytest.mark.parametrize("""input_in_memory_max_size""" , ["""default""", 0, 100 * 2**20, 900 * 2**20]       )
def       __UpperCamelCase						(		snake_case__ , snake_case__ , snake_case__       ):
	if input_in_memory_max_size != "default":
		monkeypatch.setattr(datasets.config , """IN_MEMORY_MAX_SIZE""" , snake_case__       )
	A_		:    Optional[Any]						     = datasets.config.IN_MEMORY_MAX_SIZE
	if input_in_memory_max_size == "default":
		assert in_memory_max_size == 0
	else:
		assert in_memory_max_size == input_in_memory_max_size
	if dataset_size and in_memory_max_size:
		A_		:    str						     = dataset_size < in_memory_max_size
	else:
		A_		:    Optional[Any]						     = False
	A_		:    Dict						     = is_small_dataset(snake_case__       )
	assert result == expected









"""simple docstring"""
from __future__ import annotations






def       __UpperCamelCase						(		snake_case__ , snake_case__ = None , snake_case__ = None       ):
	if start is None:
		A_		:    Dict						     = 0

	if end is None:
		A_		:    Dict						     = len(snake_case__       ) - 1

	if start >= end:
		return

	A_		:    List[Any]						     = (start + end) // 2

	slowsort(snake_case__ , snake_case__ , snake_case__       )
	slowsort(snake_case__ , mid + 1 , snake_case__       )

	if sequence[end] < sequence[mid]:
		A_     ,  A_		:    Dict						     = sequence[mid], sequence[end]

	slowsort(snake_case__ , snake_case__ , end - 1       )


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

							testmod()

