





from collections.abc import Callable






def      lowerCamelCase__      (__lowerCamelCase,							__lowerCamelCase,							__lowerCamelCase						):
     _SCREAMING_SNAKE_CASE							:						Tuple         =				a
     _SCREAMING_SNAKE_CASE							:						Union[str, Any]         =				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:
          _SCREAMING_SNAKE_CASE							:						Dict         =				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:
                    _SCREAMING_SNAKE_CASE							:						List[Any]         =				mid
               else:
                    _SCREAMING_SNAKE_CASE							:						Optional[int]         =				mid
               _SCREAMING_SNAKE_CASE							:						List[Any]         =				start + (end - start) / 2.0
          return mid






def      lowerCamelCase__      (__lowerCamelCase						):
     return x**3 - 2 * x - 5


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

       import doctest

       doctest.testmod()






'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_torch_available,
)


A__							:  Any    ={
    '''configuration_speecht5''': [
        '''SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP''',
        '''SpeechT5Config''',
        '''SpeechT5HifiGanConfig''',
    ],
    '''feature_extraction_speecht5''': ['''SpeechT5FeatureExtractor'''],
    '''processing_speecht5''': ['''SpeechT5Processor'''],
}

try:
      if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__							:  Union[str, Any]    =['''SpeechT5Tokenizer''']

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__							:  List[Any]    =[
          '''SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''SpeechT5ForSpeechToText''',
          '''SpeechT5ForSpeechToSpeech''',
          '''SpeechT5ForTextToSpeech''',
          '''SpeechT5Model''',
          '''SpeechT5PreTrainedModel''',
          '''SpeechT5HifiGan''',
      ]

if TYPE_CHECKING:
      from .configuration_speechta import (
          SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP,
          SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP,
          SpeechTaConfig,
          SpeechTaHifiGanConfig,
      )
      from .feature_extraction_speechta import SpeechTaFeatureExtractor
      from .processing_speechta import SpeechTaProcessor

      try:
            if not is_sentencepiece_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_speechta import SpeechTaTokenizer

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_speechta import (
                SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST,
                SpeechTaForSpeechToSpeech,
                SpeechTaForSpeechToText,
                SpeechTaForTextToSpeech,
                SpeechTaHifiGan,
                SpeechTaModel,
                SpeechTaPreTrainedModel,
            )

else:
      import sys

      A__							:  Tuple    =_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






