






def __A    (      __lowerCAmelCase	)->  int:





						"""simple docstring"""



						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'	)

						_UpperCAmelCase									=			0
						_UpperCAmelCase									=			str(__lowerCAmelCase	)

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

												_UpperCAmelCase									=			1
												for i in range(0 ,		len(__lowerCAmelCase	)	):
																		total *= numbers[i]

												_UpperCAmelCase									=			str(__lowerCAmelCase	)

												steps += 1
						return steps


def __A    (      __lowerCAmelCase	)->  int:





						"""simple docstring"""



						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'	)

						_UpperCAmelCase									=			0
						_UpperCAmelCase									=			str(__lowerCAmelCase	)

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

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

												_UpperCAmelCase									=			str(__lowerCAmelCase	)

												steps += 1
						return steps


if __name__ == "__main__":
		import doctest

		doctest.testmod()




'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A__		:					List[Any]												=  {
    """configuration_megatron_bert""": ["""MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MegatronBertConfig"""],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__		:					int												=  [
          """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

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






