






"""simple docstring"""



import pytest

from datasets.parallel import ParallelBackendConfig, parallel_backend
from datasets.utils.py_utils import map_nested

from .utils import require_dill_gt_0_3_2, require_joblibspark, require_not_windows

def  _snake_case				(     lowerCamelCase__	:    Optional[int]  )				->	Optional[Any]:  # picklable for multiprocessing
							return i + 1

@require_dill_gt_0_3_2
@require_joblibspark
@require_not_windows
def  _snake_case				(     )				->	Union[str, Any]:





							with parallel_backend("spark"  ):
														assert ParallelBackendConfig.backend_name == "spark"

							lowerCamelCase_       :							str									=[1, 2, 3]
							with pytest.raises(__SCREAMING_SNAKE_CASE  ):
														with parallel_backend("unsupported backend"  ):
																					map_nested(__SCREAMING_SNAKE_CASE				,						__SCREAMING_SNAKE_CASE				,						num_proc=2  )

							with pytest.raises(__SCREAMING_SNAKE_CASE  ):
														with parallel_backend("unsupported backend"  ):
																					map_nested(__SCREAMING_SNAKE_CASE				,						__SCREAMING_SNAKE_CASE				,						num_proc=-1  )

@require_dill_gt_0_3_2
@require_joblibspark
@require_not_windows
@pytest.mark.parametrize("num_proc"				,						[2, -1]  )
def  _snake_case				(     lowerCamelCase__	:    int  )				->	Optional[Any]:
							lowerCamelCase_       :							Union[str, Any]									=[1, 2]
							lowerCamelCase_       :							Optional[int]									={'''a''': 1, '''b''': 2}
							lowerCamelCase_       :							Optional[int]									={'''a''': [1, 2], '''b''': [3, 4]}
							lowerCamelCase_       :							List[Any]									={'''a''': {'''1''': 1}, '''b''': 2}
							lowerCamelCase_       :							Any									={'''a''': 1, '''b''': 2, '''c''': 3, '''d''': 4}
							lowerCamelCase_       :							Union[str, Any]									=[2, 3]
							lowerCamelCase_       :							Tuple									={'''a''': 2, '''b''': 3}
							lowerCamelCase_       :							Optional[int]									={'''a''': [2, 3], '''b''': [4, 5]}
							lowerCamelCase_       :							int									={'''a''': {'''1''': 2}, '''b''': 3}
							lowerCamelCase_       :							Optional[Any]									={'''a''': 2, '''b''': 3, '''c''': 4, '''d''': 5}

							with parallel_backend("spark"  ):
														assert map_nested(__SCREAMING_SNAKE_CASE				,						__SCREAMING_SNAKE_CASE				,						num_proc=__SCREAMING_SNAKE_CASE  ) == expected_map_nested_sa
														assert map_nested(__SCREAMING_SNAKE_CASE				,						__SCREAMING_SNAKE_CASE				,						num_proc=__SCREAMING_SNAKE_CASE  ) == expected_map_nested_sa
														assert map_nested(__SCREAMING_SNAKE_CASE				,						__SCREAMING_SNAKE_CASE				,						num_proc=__SCREAMING_SNAKE_CASE  ) == expected_map_nested_sa
														assert map_nested(__SCREAMING_SNAKE_CASE				,						__SCREAMING_SNAKE_CASE				,						num_proc=__SCREAMING_SNAKE_CASE  ) == expected_map_nested_sa
														assert map_nested(__SCREAMING_SNAKE_CASE				,						__SCREAMING_SNAKE_CASE				,						num_proc=__SCREAMING_SNAKE_CASE  ) == expected_map_nested_sa





'''simple docstring'''







def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: int							):



						"""simple docstring"""





						lowercase_	:     Optional[int]													=       int(__SCREAMING_SNAKE_CASE							)
						if decimal in (0, 1):  # Exit cases for the recursion
												return str(__SCREAMING_SNAKE_CASE							)
						lowercase_						, lowercase_	:     List[str]													=       divmod(__SCREAMING_SNAKE_CASE      ,      2							)
						return binary_recursive(__SCREAMING_SNAKE_CASE							) + str(__SCREAMING_SNAKE_CASE							)
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: str							):



						"""simple docstring"""





						lowercase_	:     str													=       str(__SCREAMING_SNAKE_CASE							).strip()
						if not number:
												raise ValueError('''No input value was provided'''							)
						lowercase_	:     Optional[int]													=       '''-''' if number.startswith('''-'''							) else ''''''
						lowercase_	:     Union[str, Any]													=       number.lstrip('''-'''							)
						if not number.isnumeric():
												raise ValueError('''Input value is not an integer'''							)
						return F'''{negative}0b{binary_recursive(int(__SCREAMING_SNAKE_CASE							)							)}'''


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

							testmod()



