


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE			: Optional[Any]				   =					{
    "configuration_megatron_bert": ["MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegatronBertConfig"],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 SCREAMING_SNAKE_CASE			: Optional[Any]				   =					[
     "MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST",
     "MegatronBertForCausalLM",
     "MegatronBertForMaskedLM",
     "MegatronBertForMultipleChoice",
     "MegatronBertForNextSentencePrediction",
     "MegatronBertForPreTraining",
     "MegatronBertForQuestionAnswering",
     "MegatronBertForSequenceClassification",
     "MegatronBertForTokenClassification",
     "MegatronBertModel",
     "MegatronBertPreTrainedModel",
 ]

if TYPE_CHECKING:
 from .configuration_megatron_bert import MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MegatronBertConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_megatron_bert import (
      MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
      MegatronBertForCausalLM,
      MegatronBertForMaskedLM,
      MegatronBertForMultipleChoice,
      MegatronBertForNextSentencePrediction,
      MegatronBertForPreTraining,
      MegatronBertForQuestionAnswering,
      MegatronBertForSequenceClassification,
      MegatronBertForTokenClassification,
      MegatronBertModel,
      MegatronBertPreTrainedModel,
  )

else:
 import sys

 SCREAMING_SNAKE_CASE			: 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			:				List[str] 						=						0
    _lowercase			:				Optional[int] 						=						str(lowerCamelCase_					)

    while len(lowerCamelCase_					) != 1:
        _lowercase			:				Any 						=						[int(lowerCamelCase_					) for i in num_string]

        _lowercase			:				List[Any] 						=						1
        for i in range(0				,					len(lowerCamelCase_					)					):
            total *= numbers[i]

        _lowercase			:				Optional[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			:				Optional[int] 						=						0
    _lowercase			:				str 						=						str(lowerCamelCase_					)

    while len(lowerCamelCase_					) != 1:
        _lowercase			:				Dict 						=						[int(lowerCamelCase_					) for i in num_string]

        _lowercase			:				Any 						=						0
        for i in range(0				,					len(lowerCamelCase_					)					):
            total += numbers[i]

        _lowercase			:				Dict 						=						str(lowerCamelCase_					)

        steps += 1
    return steps


if __name__ == "__main__":
 import doctest

 doctest.testmod()


