
from ...configuration_utils import PretrainedConfig
from ...utils import logging


_UpperCAmelCase      :				List[str]          = logging.get_logger(__name__)







class        lowercase      (	__lowercase     ):
		__lowercase : Union[str, Any]			  =       '''timm_backbone'''



		def __init__(				self       ,   A_=None       ,   A_=3       ,   A_=True       ,   A_=True       ,   A_=None       ,   **A_       ,   )						->      List[Any]:
				"""simple docstring"""
				super().__init__(**__a )
				UpperCamelCase						=  backbone
				UpperCamelCase						=  num_channels
				UpperCamelCase						=  features_only
				UpperCamelCase						=  use_pretrained_backbone
				UpperCamelCase						=  True
				UpperCamelCase						=  out_indices if out_indices is not None else (-1,)


from collections.abc import Callable


def    A (      lowercase					, lowercase					, lowercase				)     ->						float:
		'''simple docstring'''

		UpperCamelCase						=  a
		UpperCamelCase						=  b
		if function(lowercase				) == 0:  # one of the a or b is a root for the function
				return a
		elif function(lowercase				) == 0:
				return b
		elif (
		    function(lowercase				) * function(lowercase				) > 0
		):  # if none of these are root and they are both positive or negative,
				# then this algorithm can't find the root
				raise ValueError('could not find root in given interval.'				)
		else:
				UpperCamelCase						=  start + (end - start) / 2.0
				while abs(start - mid				) > 10**-7:  # until precisely equals to 10^-7
						if function(lowercase				) == 0:
								return mid
						elif function(lowercase				) * function(lowercase				) < 0:
								UpperCamelCase						=  mid
						else:
								UpperCamelCase						=  mid
						UpperCamelCase						=  start + (end - start) / 2.0
				return mid


def    A (      lowercase				)     ->						float:
		'''simple docstring'''

		return x**3 - 2 * x - 5


if __name__ == "__main__":
					print(bisection(f, 1, 1_000))

					import doctest

					doctest.testmod()
