

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







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







def  _A		(     snake_case					)      ->     int:
   return x**3 - 2 * x - 5


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

    import doctest

    doctest.testmod()









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


_snake_case         =  logging.get_logger(__name__)

_snake_case         =  {
    'weiweishi/roc-bert-base-zh': 'https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json',
}


class        a__  (							lowerCamelCase_  ):
   _SCREAMING_SNAKE_CASE   :					Any     	=							'roc_bert'


   def __init__(			self      ,    _UpperCamelCase=30522      ,    _UpperCamelCase=768      ,    _UpperCamelCase=12      ,    _UpperCamelCase=12      ,    _UpperCamelCase=3072      ,    _UpperCamelCase="gelu"      ,    _UpperCamelCase=0.1      ,    _UpperCamelCase=0.1      ,    _UpperCamelCase=512      ,    _UpperCamelCase=2      ,    _UpperCamelCase=0.0_2      ,    _UpperCamelCase=1E-1_2      ,    _UpperCamelCase=True      ,    _UpperCamelCase=0      ,    _UpperCamelCase="absolute"      ,    _UpperCamelCase=None      ,    _UpperCamelCase=True      ,    _UpperCamelCase=True      ,    _UpperCamelCase=768      ,    _UpperCamelCase=910      ,    _UpperCamelCase=512      ,    _UpperCamelCase=24858      ,    _UpperCamelCase=True      ,    **_UpperCamelCase      ,    ):





      """simple docstring"""





      _lowercase      :				str      					=       vocab_size
      _lowercase      :				List[str]      					=       max_position_embeddings
      _lowercase      :				List[Any]      					=       hidden_size
      _lowercase      :				Dict      					=       num_hidden_layers
      _lowercase      :				str      					=       num_attention_heads
      _lowercase      :				int      					=       intermediate_size
      _lowercase      :				Optional[Any]      					=       hidden_act
      _lowercase      :				Union[str, Any]      					=       hidden_dropout_prob
      _lowercase      :				Dict      					=       attention_probs_dropout_prob
      _lowercase      :				Dict      					=       initializer_range
      _lowercase      :				List[Any]      					=       type_vocab_size
      _lowercase      :				Tuple      					=       layer_norm_eps
      _lowercase      :				Optional[int]      					=       use_cache
      _lowercase      :				Tuple      					=       enable_pronunciation
      _lowercase      :				Optional[int]      					=       enable_shape
      _lowercase      :				int      					=       pronunciation_embed_dim
      _lowercase      :				List[str]      					=       pronunciation_vocab_size
      _lowercase      :				int      					=       shape_embed_dim
      _lowercase      :				str      					=       shape_vocab_size
      _lowercase      :				str      					=       concat_input
      _lowercase      :				Dict      					=       position_embedding_type
      _lowercase      :				Optional[Any]      					=       classifier_dropout
      super().__init__(pad_token_id=_UpperCamelCase      ,    **_UpperCamelCase  )






