


from typing import TYPE_CHECKING

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


lowerCamelCase		      = {'configuration_levit': ['LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'LevitConfig', 'LevitOnnxConfig']}

try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase		      = ['LevitFeatureExtractor']
 lowerCamelCase		      = ['LevitImageProcessor']

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase		      = [
     'LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST',
     'LevitForImageClassification',
     'LevitForImageClassificationWithTeacher',
     'LevitModel',
     'LevitPreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_levit import LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, LevitConfig, LevitOnnxConfig

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .feature_extraction_levit import LevitFeatureExtractor
  from .image_processing_levit import LevitImageProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_levit import (
      LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
      LevitForImageClassification,
      LevitForImageClassificationWithTeacher,
      LevitModel,
      LevitPreTrainedModel,
  )
else:
 import sys

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






from __future__ import annotations

from collections.abc import Generator




def 			a_   (					SCREAMING_SNAKE_CASE__      :   int  ):
       '''simple docstring'''





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

       yield n
       while n != 1:
              if n % 2 == 0:
                     n //= 2
              else:
                     _lowerCamelCase :	Optional[int]						=3 * n + 1
              yield n




def 			a_   (					):
       '''simple docstring'''





       _lowerCamelCase :	Dict						=43
       _lowerCamelCase :	Dict						=tuple(collatz_sequence(SCREAMING_SNAKE_CASE__  )  )
       print(SCREAMING_SNAKE_CASE__  )
       print(F'''Collatz sequence from {n} took {len(SCREAMING_SNAKE_CASE__  )} steps.'''  )


if __name__ == "__main__":
 main()


