'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase__  :      Dict        =					logging.get_logger(__name__)

lowercase__  :      Tuple        =					{
    "uw-madison/mra-base-512-4": "https://huggingface.co/uw-madison/mra-base-512-4/resolve/main/config.json",
}







class lowerCamelCase							(	lowerCamelCase					):




  '''simple docstring'''



  lowerCAmelCase__										=	'''mra'''






  def __init__(      self			:       List[str]  ,							UpperCAmelCase__			:       Optional[int]=5_0265  ,							UpperCAmelCase__			:       Tuple=768  ,							UpperCAmelCase__			:       Dict=12  ,							UpperCAmelCase__			:       Tuple=12  ,							UpperCAmelCase__			:       int=3072  ,							UpperCAmelCase__			:       List[str]="gelu"  ,							UpperCAmelCase__			:       List[str]=0.1  ,							UpperCAmelCase__			:       Tuple=0.1  ,							UpperCAmelCase__			:       str=512  ,							UpperCAmelCase__			:       Any=1  ,							UpperCAmelCase__			:       Dict=0.02  ,							UpperCAmelCase__			:       str=1e-5  ,							UpperCAmelCase__			:       Any="absolute"  ,							UpperCAmelCase__			:       Optional[Any]=4  ,							UpperCAmelCase__			:       Tuple="full"  ,							UpperCAmelCase__			:       List[Any]=0  ,							UpperCAmelCase__			:       List[str]=0  ,							UpperCAmelCase__			:       Dict=1  ,							UpperCAmelCase__			:       List[str]=0  ,							UpperCAmelCase__			:       Optional[int]=2  ,							**UpperCAmelCase__			:       List[str]  ,							)				->Optional[Any]:
        super().__init__(pad_token_id=UpperCAmelCase__  ,							bos_token_id=UpperCAmelCase__  ,							eos_token_id=UpperCAmelCase__  ,							**UpperCAmelCase__  )

        UpperCAmelCase_            =  vocab_size
        UpperCAmelCase_            =  max_position_embeddings
        UpperCAmelCase_            =  hidden_size
        UpperCAmelCase_            =  num_hidden_layers
        UpperCAmelCase_            =  num_attention_heads
        UpperCAmelCase_            =  intermediate_size
        UpperCAmelCase_            =  hidden_act
        UpperCAmelCase_            =  hidden_dropout_prob
        UpperCAmelCase_            =  attention_probs_dropout_prob
        UpperCAmelCase_            =  initializer_range
        UpperCAmelCase_            =  type_vocab_size
        UpperCAmelCase_            =  layer_norm_eps
        UpperCAmelCase_            =  position_embedding_type
        UpperCAmelCase_            =  block_per_row
        UpperCAmelCase_            =  approx_mode
        UpperCAmelCase_            =  initial_prior_first_n_blocks
        UpperCAmelCase_            =  initial_prior_diagonal_n_blocks






'''simple docstring'''
from collections.abc import Callable



def  __lowerCamelCase       (      _UpperCamelCase  :  Callable[[float], float]							,    _UpperCamelCase  :  float							,    _UpperCamelCase  :  float					):


      '''simple docstring'''


      UpperCAmelCase_            =  a
      UpperCAmelCase_            =  b
      if function(_UpperCamelCase					) == 0:  # one of the a or b is a root for the function
            return a
      elif function(_UpperCamelCase					) == 0:
            return b
      elif (
          function(_UpperCamelCase					) * function(_UpperCamelCase					) > 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(_UpperCamelCase					) == 0:
                        return mid
                  elif function(_UpperCamelCase					) * function(_UpperCamelCase					) < 0:
                        UpperCAmelCase_            =  mid
                  else:
                        UpperCAmelCase_            =  mid
                  UpperCAmelCase_            =  start + (end - start) / 2.0
            return mid



def  __lowerCamelCase       (      _UpperCamelCase  :  float					):


      '''simple docstring'''


      return x**3 - 2 * x - 5


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

      import doctest

      doctest.testmod()





