


"""simple docstring"""







from collections.abc import Callable
def 					a__			(				SCREAMING_SNAKE_CASE    :    Callable[[float], float]				,      SCREAMING_SNAKE_CASE    :    float				,      SCREAMING_SNAKE_CASE    :    float				):


  '''simple docstring'''







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


  '''simple docstring'''







  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


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

_lowerCAmelCase    :Any     =					{
    'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json',
    'tiiuae/falcon-7b': 'https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json',
}
class 							_UpperCAmelCase							( a      ):





     '''simple docstring'''



     a__									='''falcon'''
     a__									=['''past_key_values''']





     def __init__(					self       ,	A=6_5_0_2_4       ,	A=4_5_4_4       ,	A=3_2       ,	A=7_1       ,	A=1E-5       ,	A=0.02       ,	A=True       ,	A=0.0       ,	A=0.0       ,	A=None       ,	A=False       ,	A=False       ,	A=True       ,	A=True       ,	A=False       ,	A=1_1       ,	A=1_1       ,	**A       ,	)							->					Any:
         _UpperCAmelCase							:  int											=    vocab_size
         # Backward compatibility with n_embed kwarg
         _UpperCAmelCase							:  Optional[Any]											=    kwargs.pop('''n_embed'''       ,	A		)
         _UpperCAmelCase							:  int											=    hidden_size if n_embed is None else n_embed
         _UpperCAmelCase							:  List[str]											=    num_hidden_layers
         _UpperCAmelCase							:  Tuple											=    num_attention_heads
         _UpperCAmelCase							:  Optional[int]											=    layer_norm_epsilon
         _UpperCAmelCase							:  Tuple											=    initializer_range
         _UpperCAmelCase							:  Optional[int]											=    use_cache
         _UpperCAmelCase							:  Any											=    hidden_dropout
         _UpperCAmelCase							:  Dict											=    attention_dropout

         _UpperCAmelCase							:  Any											=    bos_token_id
         _UpperCAmelCase							:  List[Any]											=    eos_token_id
         _UpperCAmelCase							:  Tuple											=    num_attention_heads if num_kv_heads is None else num_kv_heads
         _UpperCAmelCase							:  Dict											=    alibi
         _UpperCAmelCase							:  Optional[int]											=    new_decoder_architecture
         _UpperCAmelCase							:  str											=    multi_query  # Ignored when new_decoder_architecture is True
         _UpperCAmelCase							:  Optional[int]											=    parallel_attn
         _UpperCAmelCase							:  Optional[int]											=    bias

         super().__init__(bos_token_id=A       ,	eos_token_id=A       ,	**A		)





     @property
     def  __lowerCAmelCase	(					self		)							->					List[str]:
         return self.hidden_size // self.num_attention_heads





     @property
     def  __lowerCAmelCase	(					self		)							->					List[Any]:
         return not self.alibi


