





'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowercase       						=			{
    'configuration_megatron_bert': ['MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MegatronBertConfig'],
}

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

       _lowercase       						=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)








'''simple docstring'''







from __future__ import annotations

from collections.abc import Iterator
class 			_lowercase						:







     def __init__( self    ,   A__    ) ->	None:
      snake_case				=			value
      snake_case				=			None
      snake_case				=			None




class 			_lowercase						:







     def __init__( self    ,   A__    ) ->	None:
      snake_case				=			tree







     def     UpperCamelCase			( self    ,   A__    ) ->	int:
      if node is None:
       return 0
      return node.value + (
          self.depth_first_search(node.left    ) + self.depth_first_search(node.right    )
      )







     def __iter__( self    ) ->	Iterator[int]:
      yield self.depth_first_search(self.tree    )


if __name__ == "__main__":
   import doctest

   doctest.testmod()

