


'''simple docstring'''

def 					_A			(			snake_case__    :			list[int]						,						snake_case__    :			int				):
	snake_case__			:			int             =		len(UpperCamelCase__				)
	snake_case__			:			int             =		[[False] * (required_sum + 1) for _ in range(arr_len + 1				)]

	# for each arr value, a sum of zero(0) can be formed by not taking any element
	# hence True/1
	for i in range(arr_len + 1				):
		snake_case__			:			List[str]             =		True

	# sum is not zero and set is empty then false
	for i in range(1						,						required_sum + 1				):
		snake_case__			:			Optional[int]             =		False

	for i in range(1						,						arr_len + 1				):
		for j in range(1						,						required_sum + 1				):
			if arr[i - 1] > j:
				snake_case__			:			Dict             =		subset[i - 1][j]
			if arr[i - 1] <= j:
				snake_case__			:			List[str]             =		subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]

	return subset[arr_len][required_sum]


if __name__ == "__main__":
		import doctest

		doctest.testmod()









"""simple docstring"""

import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline


@pytest.mark.integration
def lowerCAmelCase_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT			):
  with pytest.raises(UpperCamelCase__			):
   requests.request("""GET"""					, """https://huggingface.co"""			)
  with pytest.raises(requests.exceptions.ConnectTimeout			):
   requests.request("""GET"""					, """https://huggingface.co"""					, timeout=1.0			)


@pytest.mark.integration
def lowerCAmelCase_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.CONNECTION_FAILS			):
  with pytest.raises(requests.exceptions.ConnectionError			):
   requests.request("""GET"""					, """https://huggingface.co"""			)


def lowerCAmelCase_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1			):
  with pytest.raises(UpperCamelCase__			):
   http_head("""https://huggingface.co"""			)
