




"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


a_            =   {
    'configuration_deformable_detr': ['DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DeformableDetrConfig'],
}

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							a_            =   ['DeformableDetrFeatureExtractor']
							a_            =   ['DeformableDetrImageProcessor']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							a_            =   [
							    'DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'DeformableDetrForObjectDetection',
							    'DeformableDetrModel',
							    'DeformableDetrPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_deformable_detr import DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DeformableDetrConfig

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .feature_extraction_deformable_detr import DeformableDetrFeatureExtractor
														from .image_processing_deformable_detr import DeformableDetrImageProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_deformable_detr import (
														    DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST,
														    DeformableDetrForObjectDetection,
														    DeformableDetrModel,
														    DeformableDetrPreTrainedModel,
														)

else:
							import sys

							a_            =   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)









"""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))



