
from typing import TYPE_CHECKING

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


__lowerCAmelCase					:			int			      =		{'configuration_speech_encoder_decoder': ['SpeechEncoderDecoderConfig']}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __lowerCAmelCase					:			List[str]			      =		['SpeechEncoderDecoderModel']

try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __lowerCAmelCase					:			List[Any]			      =		['FlaxSpeechEncoderDecoderModel']

if TYPE_CHECKING:
     from .configuration_speech_encoder_decoder import SpeechEncoderDecoderConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_speech_encoder_decoder import SpeechEncoderDecoderModel

     try:
          if not is_flax_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_flax_speech_encoder_decoder import FlaxSpeechEncoderDecoderModel

else:
     import sys

     __lowerCAmelCase					:			Union[str, Any]			      =		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




def     UpperCAmelCase_  (						__lowerCAmelCase	) ->						int:

    if not isinstance(__lowerCAmelCase	,					__lowerCAmelCase	):
        raise ValueError('''multiplicative_persistence() only accepts integral values'''	)
    if num < 0:
        raise ValueError('''multiplicative_persistence() does not accept negative values'''	)

    __lowercase		:			Dict	    =       0
    __lowercase		:			Optional[int]	    =       str(__lowerCAmelCase	)

    while len(__lowerCAmelCase	) != 1:
        __lowercase		:			str	    =       [int(__lowerCAmelCase	) for i in num_string]

        __lowercase		:			Union[str, Any]	    =       1
        for i in range(0	,					len(__lowerCAmelCase	)	):
            total *= numbers[i]

        __lowercase		:			Any	    =       str(__lowerCAmelCase	)

        steps += 1
    return steps


def     UpperCAmelCase_  (						__lowerCAmelCase	) ->						int:

    if not isinstance(__lowerCAmelCase	,					__lowerCAmelCase	):
        raise ValueError('''additive_persistence() only accepts integral values'''	)
    if num < 0:
        raise ValueError('''additive_persistence() does not accept negative values'''	)

    __lowercase		:			Any	    =       0
    __lowercase		:			Union[str, Any]	    =       str(__lowerCAmelCase	)

    while len(__lowerCAmelCase	) != 1:
        __lowercase		:			List[str]	    =       [int(__lowerCAmelCase	) for i in num_string]

        __lowercase		:			Tuple	    =       0
        for i in range(0	,					len(__lowerCAmelCase	)	):
            total += numbers[i]

        __lowercase		:			List[str]	    =       str(__lowerCAmelCase	)

        steps += 1
    return steps


if __name__ == "__main__":
 import doctest

 doctest.testmod()


