




from collections.abc import Callable







def SCREAMING_SNAKE_CASE    (	lowercase_			,    lowercase_			,    lowercase_						)       ->	float:



       """simple docstring"""

       A__							=   a
       A__							=   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:
              A__							=   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:
                            A__							=   mid
                     else:
                            A__							=   mid
                     A__							=   start + (end - start) / 2.0
              return mid







def SCREAMING_SNAKE_CASE    (	lowercase_						)       ->	float:



       """simple docstring"""

       return x**3 - 2 * x - 5


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

  import doctest

  doctest.testmod()








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


_lowerCamelCase     :		Any								=       {
    """configuration_nezha""": ["""NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """NezhaConfig"""],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCamelCase     :		str								=       [
      """NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """NezhaForNextSentencePrediction""",
      """NezhaForMaskedLM""",
      """NezhaForPreTraining""",
      """NezhaForMultipleChoice""",
      """NezhaForQuestionAnswering""",
      """NezhaForSequenceClassification""",
      """NezhaForTokenClassification""",
      """NezhaModel""",
      """NezhaPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_nezha import (
        NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST,
        NezhaForMaskedLM,
        NezhaForMultipleChoice,
        NezhaForNextSentencePrediction,
        NezhaForPreTraining,
        NezhaForQuestionAnswering,
        NezhaForSequenceClassification,
        NezhaForTokenClassification,
        NezhaModel,
        NezhaPreTrainedModel,
    )


else:
  import sys

  _lowerCamelCase     :		List[str]								=       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


