






'''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 							lowercase_				(    __A :       int			)       ->      Optional[int]:  # picklable for multiprocessing



 """simple docstring"""




 return i + 1


@require_dill_gt_0_3_2
@require_joblibspark
@require_not_windows
def 							lowercase_				(    )       ->      Any:



 """simple docstring"""




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

 lowercase					:   List[str]				  =[1, 2, 3]
 with pytest.raises(__A			):
  with parallel_backend('''unsupported backend'''			):
   map_nested(__A					,      __A					,      num_proc=2			)

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





@require_dill_gt_0_3_2
@require_joblibspark
@require_not_windows
@pytest.mark.parametrize('''num_proc'''					,      [2, -1]			)
def 							lowercase_				(    __A :       Union[str, Any]			)       ->      Optional[Any]:



 """simple docstring"""




 lowercase					:   Any				  =[1, 2]
 lowercase					:   Dict				  ={'''a''': 1, '''b''': 2}
 lowercase					:   str				  ={'''a''': [1, 2], '''b''': [3, 4]}
 lowercase					:   List[str]				  ={'''a''': {'''1''': 1}, '''b''': 2}
 lowercase					:   Union[str, Any]				  ={'''a''': 1, '''b''': 2, '''c''': 3, '''d''': 4}
 lowercase					:   str				  =[2, 3]
 lowercase					:   Dict				  ={'''a''': 2, '''b''': 3}
 lowercase					:   int				  ={'''a''': [2, 3], '''b''': [4, 5]}
 lowercase					:   Tuple				  ={'''a''': {'''1''': 2}, '''b''': 3}
 lowercase					:   Tuple				  ={'''a''': 2, '''b''': 3, '''c''': 4, '''d''': 5}

 with parallel_backend('''spark'''			):
  assert map_nested(__A					,      __A					,      num_proc=__A			) == expected_map_nested_sa
  assert map_nested(__A					,      __A					,      num_proc=__A			) == expected_map_nested_sa
  assert map_nested(__A					,      __A					,      num_proc=__A			) == expected_map_nested_sa
  assert map_nested(__A					,      __A					,      num_proc=__A			) == expected_map_nested_sa
  assert map_nested(__A					,      __A					,      num_proc=__A			) == expected_map_nested_sa











'''simple docstring'''



import re


def 							lowercase_				(    __A :       str			)       ->      bool:



 """simple docstring"""




 lowercase					:   Any				  =re.compile(R'''^(\+91[\-\s]?)?[0]?(91)?[789]\d{9}$'''			)
 if match := re.search(__A					,      __A			):
  return match.string == phone
 return False


if __name__ == "__main__":
      print(indian_phone_validator('+918827897895'))



