


"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE					:       Optional[int]							   =							{"""configuration_visual_bert""": ["""VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """VisualBertConfig"""]}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			SCREAMING_SNAKE_CASE					:       str							   =							[
			    """VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
			    """VisualBertForMultipleChoice""",
			    """VisualBertForPreTraining""",
			    """VisualBertForQuestionAnswering""",
			    """VisualBertForRegionToPhraseAlignment""",
			    """VisualBertForVisualReasoning""",
			    """VisualBertLayer""",
			    """VisualBertModel""",
			    """VisualBertPreTrainedModel""",
			]


if TYPE_CHECKING:
			from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_visual_bert import (
						    VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    VisualBertForMultipleChoice,
						    VisualBertForPreTraining,
						    VisualBertForQuestionAnswering,
						    VisualBertForRegionToPhraseAlignment,
						    VisualBertForVisualReasoning,
						    VisualBertLayer,
						    VisualBertModel,
						    VisualBertPreTrainedModel,
						)


else:
			import sys

			SCREAMING_SNAKE_CASE					:       Union[str, Any]							   =							_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






"""simple docstring"""




from collections.abc import Callable

UpperCAmelCase       :    Optional[int]									=			Callable[[float], float]  # type alias for a real -> real function



def 				__a       (			_lowercase							, _lowercase							, _lowercase							, ):







					"""simple docstring"""





					lowerCamelCase__		:   Tuple  				=					float(_lowercase						)
					while True:
										try:
															lowerCamelCase__		:   str  				=					prev_guess - function(_lowercase						) / derivative(_lowercase						)
										except ZeroDivisionError:
															raise ZeroDivisionError('''Could not find root'''						) from None
										if abs(prev_guess - next_guess						) < 10**-5:
															return next_guess
										lowerCamelCase__		:   List[str]  				=					next_guess



def 				__a       (			_lowercase						):







					"""simple docstring"""





					return (x**3) - (2 * x) - 5



def 				__a       (			_lowercase						):







					"""simple docstring"""





					return 3 * (x**2) - 2


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






