


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    (				lowerCAmelCase_				:str		,    lowerCAmelCase_				:List[Any]		,    lowerCAmelCase_				:Optional[int]				)->Union[str, Any]:
   '''simple docstring'''






   if input_in_memory_max_size != "default":
      monkeypatch.setattr(datasets.config		,    "IN_MEMORY_MAX_SIZE"		,    lowerCAmelCase_				)
   snake_case_            =       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:
      snake_case_            =       dataset_size < in_memory_max_size
   else:
      snake_case_            =       False
   snake_case_            =       is_small_dataset(lowerCAmelCase_				)
   assert result == expected








from __future__ import annotations



def       _lowerCAmelCase    (				lowerCAmelCase_				:int		,    lowerCAmelCase_				:int				)->list[str]:
   '''simple docstring'''






   if partitions <= 0:
      raise ValueError("partitions must be a positive number!"				)
   if partitions > number_of_bytes:
      raise ValueError("partitions can not > number_of_bytes!"				)
   snake_case_            =       number_of_bytes // partitions
   snake_case_            =       []
   for i in range(lowerCAmelCase_				):
      snake_case_            =       i * bytes_per_partition + 1
      snake_case_            =       (
          number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
      )
      allocation_list.append(F'''{start_bytes}-{end_bytes}'''				)
   return allocation_list


if __name__ == "__main__":
   import doctest

   doctest.testmod()




