


'''simple docstring'''


from collections.abc import Callable




def      lowerCamelCase					(      lowerCamelCase  :      Callable[[float], float]							,						lowerCamelCase  :      float							,						lowerCamelCase  :      float):
      A_						:  float          =				a
      A_						:  float          =				b
      if function(lowerCamelCase) == 0:  # one of the a or b is a root for the function
            return a
      elif function(lowerCamelCase) == 0:
            return b
      elif (
          function(lowerCamelCase) * function(lowerCamelCase) > 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:
            A_						:  float          =				start + (end - start) / 2.0
            while abs(start - mid) > 10**-7:  # until precisely equals to 10^-7
                  if function(lowerCamelCase) == 0:
                        return mid
                  elif function(lowerCamelCase) * function(lowerCamelCase) < 0:
                        A_						:  List[str]          =				mid
                  else:
                        A_						:  Dict          =				mid
                  A_						:  Any          =				start + (end - start) / 2.0
            return mid




def      lowerCamelCase					(      lowerCamelCase  :      float):
      return x**3 - 2 * x - 5


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

     import doctest

     doctest.testmod()




'''simple docstring'''


from ... import PretrainedConfig


__magic_name__			=      {
    'sijunhe/nezha-cn-base': 'https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json',
}



class 	__lowerCAmelCase		(							__SCREAMING_SNAKE_CASE    ):


  '''simple docstring'''







  a_  					=							NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP
  a_  					=							"""nezha"""






  def __init__(							self :       int	,_a :       Union[str, Any]=21128	,_a :       int=768	,_a :       Any=12	,_a :       List[str]=12	,_a :       str=3072	,_a :       int="gelu"	,_a :       int=0.1	,_a :       str=0.1	,_a :       Tuple=512	,_a :       List[Any]=64	,_a :       Dict=2	,_a :       List[Any]=0.02	,_a :       Optional[Any]=1e-12	,_a :       List[Any]=0.1	,_a :       Union[str, Any]=0	,_a :       Any=2	,_a :       Union[str, Any]=3	,_a :       int=True	,**_a :       int	,):

        '''simple docstring'''




        super().__init__(pad_token_id=_a	,bos_token_id=_a	,eos_token_id=_a	,**_a )

        A_						:  Tuple          =				vocab_size
        A_						:  int          =				hidden_size
        A_						:  Any          =				num_hidden_layers
        A_						:  List[Any]          =				num_attention_heads
        A_						:  Tuple          =				hidden_act
        A_						:  List[Any]          =				intermediate_size
        A_						:  List[str]          =				hidden_dropout_prob
        A_						:  Tuple          =				attention_probs_dropout_prob
        A_						:  Dict          =				max_position_embeddings
        A_						:  Optional[Any]          =				max_relative_position
        A_						:  List[Any]          =				type_vocab_size
        A_						:  int          =				initializer_range
        A_						:  Tuple          =				layer_norm_eps
        A_						:  Dict          =				classifier_dropout
        A_						:  int          =				use_cache
