



'''simple docstring'''



import time
from contextlib import contextmanager
from pathlib import Path

import pytest
import requests
from huggingface_hub.hf_api import HfApi, HfFolder


lowerCAmelCase	:		Tuple				=   '''__DUMMY_TRANSFORMERS_USER__'''
lowerCAmelCase	:		Optional[int]				=   '''Dummy User'''
lowerCAmelCase	:		Dict				=   '''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'''

lowerCAmelCase	:		Tuple				=   '''https://hub-ci.huggingface.co'''
lowerCAmelCase	:		Union[str, Any]				=   CI_HUB_ENDPOINT + '''/datasets/{repo_id}/resolve/{revision}/{path}'''
lowerCAmelCase	:		List[Any]				=   CI_HUB_ENDPOINT + '''/{repo_id}/resolve/{revision}/{filename}'''
lowerCAmelCase	:		List[Any]				=   Path('''~/.huggingface/hub_ci_token''').expanduser()



@pytest.fixture
def   __lowerCAmelCase					(							lowerCamelCase   :						str					):






	'''simple docstring'''




	monkeypatch.setattr(
	    "huggingface_hub.file_download.HUGGINGFACE_CO_URL_TEMPLATE"				,		lowerCamelCase					)



@pytest.fixture
def   __lowerCAmelCase					(							lowerCamelCase   :						int					):






	'''simple docstring'''




	monkeypatch.setattr("datasets.config.HF_ENDPOINT"				,		lowerCamelCase					)
	monkeypatch.setattr("datasets.config.HUB_DATASETS_URL"				,		lowerCamelCase					)



@pytest.fixture
def   __lowerCAmelCase					(							lowerCamelCase   :						Union[str, Any]					):






	'''simple docstring'''




	monkeypatch.setattr("huggingface_hub.hf_api.HfFolder.path_token"				,		lowerCamelCase					)



@pytest.fixture
def   __lowerCAmelCase					(							lowerCamelCase   :						List[str]				,		lowerCamelCase   :						Optional[Any]					):






	'''simple docstring'''




	HfFolder.save_token(lowerCamelCase					)
	yield
	HfFolder.delete_token()



@pytest.fixture(scope="session"					)
def   __lowerCAmelCase					(							):






	'''simple docstring'''




	return HfApi(endpoint=lowerCamelCase					)



@pytest.fixture(scope="session"					)
def   __lowerCAmelCase					(							lowerCamelCase   :						HfApi					):






	'''simple docstring'''




	__lowerCAmelCase												=  HfFolder.get_token()
	HfFolder.save_token(lowerCamelCase					)
	yield CI_HUB_USER_TOKEN
	if previous_token is not None:
		HfFolder.save_token(lowerCamelCase					)



@pytest.fixture
def   __lowerCAmelCase					(							lowerCamelCase   :						str					):






	'''simple docstring'''




	def _cleanup_repo(lowerCamelCase   :						Optional[Any]					):
		hf_api.delete_repo(lowerCamelCase				,		token=lowerCamelCase				,		repo_type="dataset"					)

	return _cleanup_repo



@pytest.fixture
def   __lowerCAmelCase					(							lowerCamelCase   :						List[str]					):






	'''simple docstring'''




	@contextmanager
	def _temporary_repo(lowerCamelCase   :						Any					):
		try:
			yield repo_id
		finally:
			cleanup_repo(lowerCamelCase					)

	return _temporary_repo



@pytest.fixture(scope="session"					)
def   __lowerCAmelCase					(							lowerCamelCase   :						HfApi				,		lowerCamelCase   :						str				,		lowerCamelCase   :						Dict					):






	'''simple docstring'''




	__lowerCAmelCase												=  f'''repo_txt_data-{int(time.time() * 10e3					)}'''
	__lowerCAmelCase												=  f'''{CI_HUB_USER}/{repo_name}'''
	hf_api.create_repo(lowerCamelCase				,		token=lowerCamelCase				,		repo_type="dataset"				,		private=lowerCamelCase					)
	hf_api.upload_file(
	    token=lowerCamelCase				,		path_or_fileobj=str(lowerCamelCase					)				,		path_in_repo="data/text_data.txt"				,		repo_id=lowerCamelCase				,		repo_type="dataset"				,		)
	yield repo_id
	try:
		hf_api.delete_repo(lowerCamelCase				,		token=lowerCamelCase				,		repo_type="dataset"					)
	except (requests.exceptions.HTTPError, ValueError):  # catch http error and token invalid error
		pass



@pytest.fixture()
def   __lowerCAmelCase					(							lowerCamelCase   :						Optional[Any]				,		lowerCamelCase   :						Union[str, Any]				,		lowerCamelCase   :						Optional[int]					):






	'''simple docstring'''




	return hf_private_dataset_repo_txt_data_



@pytest.fixture(scope="session"					)
def   __lowerCAmelCase					(							lowerCamelCase   :						HfApi				,		lowerCamelCase   :						str				,		lowerCamelCase   :						List[Any]					):






	'''simple docstring'''




	__lowerCAmelCase												=  f'''repo_zipped_txt_data-{int(time.time() * 10e3					)}'''
	__lowerCAmelCase												=  f'''{CI_HUB_USER}/{repo_name}'''
	hf_api.create_repo(lowerCamelCase				,		token=lowerCamelCase				,		repo_type="dataset"				,		private=lowerCamelCase					)
	hf_api.upload_file(
	    token=lowerCamelCase				,		path_or_fileobj=str(lowerCamelCase					)				,		path_in_repo="data.zip"				,		repo_id=lowerCamelCase				,		repo_type="dataset"				,		)
	yield repo_id
	try:
		hf_api.delete_repo(lowerCamelCase				,		token=lowerCamelCase				,		repo_type="dataset"					)
	except (requests.exceptions.HTTPError, ValueError):  # catch http error and token invalid error
		pass



@pytest.fixture()
def   __lowerCAmelCase					(							lowerCamelCase   :						Union[str, Any]				,		lowerCamelCase   :						Tuple				,		lowerCamelCase   :						Any					):






	'''simple docstring'''




	return hf_private_dataset_repo_zipped_txt_data_



@pytest.fixture(scope="session"					)
def   __lowerCAmelCase					(							lowerCamelCase   :						HfApi				,		lowerCamelCase   :						Any				,		lowerCamelCase   :						Any					):






	'''simple docstring'''




	__lowerCAmelCase												=  f'''repo_zipped_img_data-{int(time.time() * 10e3					)}'''
	__lowerCAmelCase												=  f'''{CI_HUB_USER}/{repo_name}'''
	hf_api.create_repo(lowerCamelCase				,		token=lowerCamelCase				,		repo_type="dataset"				,		private=lowerCamelCase					)
	hf_api.upload_file(
	    token=lowerCamelCase				,		path_or_fileobj=str(lowerCamelCase					)				,		path_in_repo="data.zip"				,		repo_id=lowerCamelCase				,		repo_type="dataset"				,		)
	yield repo_id
	try:
		hf_api.delete_repo(lowerCamelCase				,		token=lowerCamelCase				,		repo_type="dataset"					)
	except (requests.exceptions.HTTPError, ValueError):  # catch http error and token invalid error
		pass




@pytest.fixture()
def   __lowerCAmelCase					(							lowerCamelCase   :						int				,		lowerCamelCase   :						Optional[int]				,		lowerCamelCase   :						Tuple					):






	'''simple docstring'''




	return hf_private_dataset_repo_zipped_img_data_




'''simple docstring'''



def   __lowerCAmelCase					(							lowerCamelCase   :						Union[str, Any]					):






	'''simple docstring'''




	__lowerCAmelCase												=  1
	__lowerCAmelCase												=  2
	while i * i <= n:
		__lowerCAmelCase												=  0
		while n % i == 0:
			n //= i
			multiplicity += 1
		n_divisors *= multiplicity + 1
		i += 1
	if n > 1:
		n_divisors *= 2
	return n_divisors



def   __lowerCAmelCase					(							):






	'''simple docstring'''




	__lowerCAmelCase												=  1
	__lowerCAmelCase												=  1

	while True:
		i += 1
		t_num += i

		if count_divisors(lowerCamelCase					) > 5_00:
			break

	return t_num


if __name__ == "__main__":
	print(solution())