


from typing import TYPE_CHECKING

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


__lowerCamelCase   	=  {'''configuration_bit''': ['''BIT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''BitConfig''', '''BitOnnxConfig''']}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCamelCase   	=  [
           '''BIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''BitForImageClassification''',
           '''BitModel''',
           '''BitPreTrainedModel''',
           '''BitBackbone''',
       ]


try:
       if not is_vision_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCamelCase   	=  ['''BitImageProcessor''']


if TYPE_CHECKING:
       from .configuration_bit import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BitConfig, BitOnnxConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_bit import (
                  BIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  BitBackbone,
                  BitForImageClassification,
                  BitModel,
                  BitPreTrainedModel,
              )

       try:
              if not is_vision_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .image_processing_bit import BitImageProcessor

else:
       import sys

       __lowerCamelCase   	=  _LazyModule(__name__, globals()['''__file__'''], _import_structure)




from __future__ import annotations



def       __SCREAMING_SNAKE_CASE    (   __UpperCamelCase       :			str      )				->   bool:







  """simple docstring"""





  SCREAMING_SNAKE_CASE__     				= 42
  SCREAMING_SNAKE_CASE__     				= list(__UpperCamelCase      )
  SCREAMING_SNAKE_CASE__				,	SCREAMING_SNAKE_CASE__     				= _vector[:-1], int(_vector[-1]      )
  SCREAMING_SNAKE_CASE__     				= [int(__UpperCamelCase      ) for digit in __vector]

  vector.reverse()
  for i, digit in enumerate(__UpperCamelCase      ):
    if i & 1 == 0:
      SCREAMING_SNAKE_CASE__     				= digit * 2
      if doubled > 9:
        doubled -= 9
      check_digit += doubled
    else:
      check_digit += digit

  return check_digit % 10 == 0


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   assert is_luhn('''79927398713''')
   assert not is_luhn('''79927398714''')
