




"""simple docstring"""




def      __UpperCAmelCase     ( __UpperCamelCase	):

			if not isinstance(UpperCamelCase_	,				UpperCamelCase_	):
						raise ValueError('''multiplicative_persistence() only accepts integral values'''	)
			if num < 0:
						raise ValueError('''multiplicative_persistence() does not accept negative values'''	)

			__lowercase			:  Optional[int]								=       0
			__lowercase			:  List[str]								=       str(UpperCamelCase_	)

			while len(UpperCamelCase_	) != 1:
						__lowercase			:  Tuple								=       [int(UpperCamelCase_	) for i in num_string]

						__lowercase			:  Union[str, Any]								=       1
						for i in range(0	,				len(UpperCamelCase_	)	):
									total *= numbers[i]

						__lowercase			:  List[str]								=       str(UpperCamelCase_	)

						steps += 1
			return steps







def      __UpperCAmelCase     ( __UpperCamelCase	):

			if not isinstance(UpperCamelCase_	,				UpperCamelCase_	):
						raise ValueError('''additive_persistence() only accepts integral values'''	)
			if num < 0:
						raise ValueError('''additive_persistence() does not accept negative values'''	)

			__lowercase			:  Optional[Any]								=       0
			__lowercase			:  str								=       str(UpperCamelCase_	)

			while len(UpperCamelCase_	) != 1:
						__lowercase			:  Union[str, Any]								=       [int(UpperCamelCase_	) for i in num_string]

						__lowercase			:  Optional[int]								=       0
						for i in range(0	,				len(UpperCamelCase_	)	):
									total += numbers[i]

						__lowercase			:  str								=       str(UpperCamelCase_	)

						steps += 1
			return steps


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       a_				(	):
							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       a_				(	):
							with offline(OfflineSimulationMode.CONNECTION_FAILS ):
														with pytest.raises(requests.exceptions.ConnectionError ):
																					requests.request("GET"						,  "https://huggingface.co" )







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





