
'''simple docstring'''

from __future__ import annotations

from collections.abc import Generator


def 	_UpperCAmelCase				(  _lowerCamelCase						:       List[str]		)    ->						Any:







  if not isinstance(_lowerCamelCase  ,      _lowerCamelCase		) or n < 1:
    raise Exception("""Sequence only defined for positive integers"""		)

  yield n
  while n != 1:
    if n % 2 == 0:
      n //= 2
    else:
      _lowerCAmelCase       :  int   				=					3 * n + 1
    yield n


def 	_UpperCAmelCase				(  )    ->						Tuple:
  _lowerCAmelCase       :  int   				=					43
  _lowerCAmelCase       :  List[str]   				=					tuple(collatz_sequence(_lowerCamelCase		)		)
  print(_lowerCamelCase		)
  print(f'Collatz sequence from {n} took {len(_lowerCamelCase		)} steps.'		)


if __name__ == "__main__":
      main()




'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


UpperCamelCase_     			=       {
    """configuration_gptsan_japanese""": ["""GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GPTSanJapaneseConfig"""],
    """tokenization_gptsan_japanese""": ["""GPTSanJapaneseTokenizer"""],
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase_     			=       [
         """GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """GPTSanJapaneseForConditionalGeneration""",
         """GPTSanJapaneseModel""",
         """GPTSanJapanesePreTrainedModel""",
     ]
     UpperCamelCase_     			=       [
         """GPTSanJapaneseTokenizer""",
     ]


if TYPE_CHECKING:
     from .configuration_gptsan_japanese import GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTSanJapaneseConfig
     from .tokenization_gptsan_japanese import GPTSanJapaneseTokenizer

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_gptsan_japanese import (
              GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST,
              GPTSanJapaneseForConditionalGeneration,
              GPTSanJapaneseModel,
              GPTSanJapanesePreTrainedModel,
          )
          from .tokenization_gptsan_japanese import GPTSanJapaneseTokenizer


else:
     import sys

     UpperCamelCase_     			=       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


