'''simple docstring'''




import math




def 							lowerCamelCase			(   UpperCAmelCase__ :      int				)    ->   bool:
							assert isinstance(UpperCAmelCase__   ,   UpperCAmelCase__				) and (
							    number >= 0
							), "'number' must been an int and positive"

							if 1 < number < 4:
														# 2 and 3 are primes
														return True
							elif number < 2 or not number % 2:
														# Negatives, 0, 1 and all even numbers are not primes
														return False

							lowercase_      :    Optional[Any]       		= range(3   ,   int(math.sqrt(UpperCAmelCase__				) + 1				)   ,   2				)
							return not any(not number % i for i in odd_numbers				)




def 							lowerCamelCase			(   UpperCAmelCase__ :      Dict   ,   UpperCAmelCase__ :      Optional[Any]=1   ,   **UpperCAmelCase__ :      Optional[Any]				)    ->   List[Any]:
							lowercase_      :    Optional[Any]       		= factor * value
							lowercase_      :    Dict       		= value

							while not is_prime(UpperCAmelCase__				):
														value += 1 if not ("desc" in kwargs and kwargs["desc"] is True) else -1

							if value == first_value_val:
														return next_prime(value + 1   ,   **UpperCAmelCase__				)
							return value






'''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 							lowerCamelCase			(   UpperCAmelCase__ :      Union[str, Any]   ,   UpperCAmelCase__ :      List[Any]   ,   UpperCAmelCase__ :      str				)    ->   Any:
							if input_in_memory_max_size != "default":
														monkeypatch.setattr(datasets.config   ,   """IN_MEMORY_MAX_SIZE"""   ,   UpperCAmelCase__				)
							lowercase_      :    List[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:
														lowercase_      :    str       		= dataset_size < in_memory_max_size
							else:
														lowercase_      :    List[Any]       		= False
							lowercase_      :    Any       		= is_small_dataset(UpperCAmelCase__				)
							assert result == expected





