


"""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   _a			( _SCREAMING_SNAKE_CASE			)      ->			Optional[int]:  # picklable for multiprocessing
							return i + 1







@require_dill_gt_0_3_2
@require_joblibspark
@require_not_windows
def   _a			( )      ->			Union[str, Any]:
							with parallel_backend("""spark"""			):
														assert ParallelBackendConfig.backend_name == "spark"

							snake_case_          =						[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   _a			( _SCREAMING_SNAKE_CASE			)      ->			List[str]:
							snake_case_          =						[1, 2]
							snake_case_          =						{"""a""": 1, """b""": 2}
							snake_case_          =						{"""a""": [1, 2], """b""": [3, 4]}
							snake_case_          =						{"""a""": {"""1""": 1}, """b""": 2}
							snake_case_          =						{"""a""": 1, """b""": 2, """c""": 3, """d""": 4}
							snake_case_          =						[2, 3]
							snake_case_          =						{"""a""": 2, """b""": 3}
							snake_case_          =						{"""a""": [2, 3], """b""": [4, 5]}
							snake_case_          =						{"""a""": {"""1""": 2}, """b""": 3}
							snake_case_          =						{"""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"""
from collections import namedtuple

import requests
from lxml import html  # type: ignore

__SCREAMING_SNAKE_CASE							:      List[str]						=      namedtuple('covid_data', 'cases deaths recovered')







def   _a			( _SCREAMING_SNAKE_CASE = "https://www.worldometers.info/coronavirus/"			)      ->			covid_data:
							snake_case_          =						"""//div[@class = \"maincounter-number\"]/span/text()"""
							return covid_data(*html.fromstring(requests.get(_SCREAMING_SNAKE_CASE			).content			).xpath(_SCREAMING_SNAKE_CASE			)			)


__SCREAMING_SNAKE_CASE							:      List[str]						=      'Total COVID-19 cases in the world: {}\nTotal deaths due to COVID-19 in the world: {}\nTotal COVID-19 patients recovered in the world: {}'





print(fmt.format(*covid_stats()))



