






'''simple docstring'''







import pytest

import datasets


# Import fixture modules as plugins
_A	:			Union[str, Any]         =['''tests.fixtures.files''', '''tests.fixtures.hub''', '''tests.fixtures.fsspec''']





def  SCREAMING_SNAKE_CASE_       (UpperCamelCase				,			UpperCamelCase      )      ->       List[Any]:
							# Mark tests as "unit" by default if not marked as "integration" (or already marked as "unit")
							for item in items:
														if any(marker in item.keywords for marker in ["""integration""", """unit"""]      ):
																					continue
														item.add_marker(pytest.mark.unit      )





def  SCREAMING_SNAKE_CASE_       (UpperCamelCase      )      ->       int:
							config.addinivalue_line("""markers"""				,			"""torchaudio_latest: mark test to run with torchaudio>=0.12"""      )





@pytest.fixture(autouse=UpperCamelCase      )
def  SCREAMING_SNAKE_CASE_       (UpperCamelCase				,			UpperCamelCase      )      ->       Any:
							# test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
							lowerCamelCase__					:	Dict         =       tmp_path_factory.getbasetemp() / """cache"""
							lowerCamelCase__					:	Optional[Any]         =       test_hf_cache_home / """datasets"""
							lowerCamelCase__					:	List[Any]         =       test_hf_cache_home / """metrics"""
							lowerCamelCase__					:	List[str]         =       test_hf_cache_home / """modules"""
							monkeypatch.setattr("""datasets.config.HF_DATASETS_CACHE"""				,			str(UpperCamelCase      )      )
							monkeypatch.setattr("""datasets.config.HF_METRICS_CACHE"""				,			str(UpperCamelCase      )      )
							monkeypatch.setattr("""datasets.config.HF_MODULES_CACHE"""				,			str(UpperCamelCase      )      )
							lowerCamelCase__					:	str         =       test_hf_datasets_cache / """downloads"""
							monkeypatch.setattr("""datasets.config.DOWNLOADED_DATASETS_PATH"""				,			str(UpperCamelCase      )      )
							lowerCamelCase__					:	Optional[Any]         =       test_hf_datasets_cache / """downloads""" / """extracted"""
							monkeypatch.setattr("""datasets.config.EXTRACTED_DATASETS_PATH"""				,			str(UpperCamelCase      )      )





@pytest.fixture(autouse=UpperCamelCase				,			scope="""session"""      )
def  SCREAMING_SNAKE_CASE_       ()      ->       int:
							datasets.disable_progress_bar()





@pytest.fixture(autouse=UpperCamelCase      )
def  SCREAMING_SNAKE_CASE_       (UpperCamelCase      )      ->       Union[str, Any]:
							# don't take tests into account when counting downloads
							monkeypatch.setattr("""datasets.config.HF_UPDATE_DOWNLOAD_COUNTS"""				,			UpperCamelCase      )





@pytest.fixture
def  SCREAMING_SNAKE_CASE_       (UpperCamelCase      )      ->       Optional[int]:
							# Required to suppress RemovedIn20Warning when feature(s) are not compatible with SQLAlchemy 2.0
							# To be removed once SQLAlchemy 2.0 supported
							monkeypatch.setattr("""sqlalchemy.util.deprecations.SILENCE_UBER_WARNING"""				,			UpperCamelCase      )









'''simple docstring'''







class _lowercase	:




							def __init__(							self:				Tuple			,							UpperCamelCase__:				list[int]     ):
														lowerCamelCase__					:	Union[str, Any]         =       len(UpperCamelCase__     )
														lowerCamelCase__					:	Union[str, Any]         =       [0] * len_array

														if len_array > 0:
																					lowerCamelCase__					:	Union[str, Any]         =       array[0]

														for i in range(1			,							UpperCamelCase__     ):
																					lowerCamelCase__					:	Tuple         =       self.prefix_sum[i - 1] + array[i]




							def 		lowerCamelCase_				(							self:				Tuple			,							UpperCamelCase__:				int			,							UpperCamelCase__:				int     ):
														if start == 0:
																					return self.prefix_sum[end]

														return self.prefix_sum[end] - self.prefix_sum[start - 1]




							def 		lowerCamelCase_				(							self:				Optional[int]			,							UpperCamelCase__:				int     ):
														lowerCamelCase__					:	Dict         =       {0}
														for sum_item in self.prefix_sum:
																					if sum_item - target_sum in sums:
																												return True

																					sums.add(UpperCamelCase__     )

														return False


if __name__ == "__main__":
			import doctest

			doctest.testmod()

