




"""simple docstring"""




import unittest
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import Mock, patch

import diffusers.utils.hub_utils

class        UpperCAmelCase_  (	unittest.TestCase						):
		@patch('''diffusers.utils.hub_utils.get_full_repo_name'''   )
		def 					_lowerCamelCase    (		self							,		UpperCamelCase_   )		->   None:
					__lowercase	:       str				=   '''full_repo_name'''
					with TemporaryDirectory() as tmpdir:
								# Dummy args values
								__lowercase	:       Dict				=   Mock()
								__lowercase	:       int				=   tmpdir
								__lowercase	:       Union[str, Any]				=   0
								__lowercase	:       Dict				=   '''hub_token'''
								__lowercase	:       Optional[Any]				=   '''dataset_name'''
								__lowercase	:       Dict				=   0.0_1
								__lowercase	:       List[str]				=   10_00_00
								__lowercase	:       Union[str, Any]				=   1_00_00
								__lowercase	:       Optional[int]				=   0.0_1
								__lowercase	:       str				=   0.0_2
								__lowercase	:       int				=   0.0_3
								__lowercase	:       List[Any]				=   0.0_0_0_5
								__lowercase	:       str				=   0.0_0_0_0_0_1
								__lowercase	:       Dict				=   1
								__lowercase	:       Dict				=   10
								__lowercase	:       List[str]				=   0.0_0_1
								__lowercase	:       str				=   0.1
								__lowercase	:       Any				=   0.2
								__lowercase	:       str				=   True

								# Model card mush be rendered and saved
								diffusers.utils.hub_utils.create_model_card(UpperCamelCase_							,		model_name='''model_name'''   )
								self.assertTrue((Path(UpperCamelCase_   ) / '''README.md''').is_file()   )









"""simple docstring"""




from collections.abc import Callable

a_            =   Callable[[float], float]  # type alias for a real -> real function







def       __UpperCAmelCase      (				__UpperCamelCase					,							__UpperCamelCase					,							__UpperCamelCase					,							):
			__lowercase	:       str				=   float(__UpperCamelCase					)
			while True:
						try:
									__lowercase	:       Dict				=   prev_guess - function(__UpperCamelCase					) / derivative(__UpperCamelCase					)
						except ZeroDivisionError:
									raise ZeroDivisionError('''Could not find root'''					) from None
						if abs(prev_guess - next_guess					) < 10**-5:
									return next_guess
						__lowercase	:       List[Any]				=   next_guess







def       __UpperCAmelCase      (				__UpperCamelCase					):
			return (x**3) - (2 * x) - 5







def       __UpperCAmelCase      (				__UpperCamelCase					):
			return 3 * (x**2) - 2


if __name__ == "__main__":
			print(newton(f, fa, 3))



