


from string import ascii_uppercase

__lowerCamelCase        =     {str(ord(c) - 55): c for c in ascii_uppercase}



def  _a			(						__UpperCamelCase  ,  __UpperCamelCase ):
     if isinstance(lowerCAmelCase__  ,  lowerCAmelCase__ ):
          raise TypeError("""int() can't convert non-string with explicit base""" )
     if num < 0:
          raise ValueError("""parameter must be positive int""" )
     if isinstance(lowerCAmelCase__  ,  lowerCAmelCase__ ):
          raise TypeError("""'str' object cannot be interpreted as an integer""" )
     if isinstance(lowerCAmelCase__  ,  lowerCAmelCase__ ):
          raise TypeError("""'float' object cannot be interpreted as an integer""" )
     if base in (0, 1):
          raise ValueError("""base must be >= 2""" )
     if base > 3_6:
          raise ValueError("""base must be <= 36""" )
     a_    :     int										=    """"""
     a_    :     List[Any]										=    0
     a_    :     Tuple										=    0
     while div != 1:
          a_			,			a_    :     Optional[int]										=    divmod(lowerCAmelCase__  ,  lowerCAmelCase__ )
          if base >= 1_1 and 9 < mod < 3_6:
               a_    :     Optional[Any]										=    ALPHABET_VALUES[str(lowerCAmelCase__ )]
          else:
               a_    :     Tuple										=    str(lowerCAmelCase__ )
          new_value += actual_value
          a_    :     Any										=    num // base
          a_    :     int										=    div
          if div == 0:
               return str(new_value[::-1] )
          elif div == 1:
               new_value += str(lowerCAmelCase__ )
               return str(new_value[::-1] )

     return new_value[::-1]


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       for base in range(2, 37):
              for num in range(1000):
                     assert int(decimal_to_any(num, base), base) == num, (
                         num,
                         base,
                         decimal_to_any(num, base),
                         int(decimal_to_any(num, base), base),
                     )






from typing import TYPE_CHECKING

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


__lowerCamelCase        =     {'''configuration_vit''': ['''VIT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ViTConfig''', '''ViTOnnxConfig''']}

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

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCamelCase        =     [
           '''VIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''ViTForImageClassification''',
           '''ViTForMaskedImageModeling''',
           '''ViTModel''',
           '''ViTPreTrainedModel''',
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCamelCase        =     [
           '''TFViTForImageClassification''',
           '''TFViTModel''',
           '''TFViTPreTrainedModel''',
       ]

try:
       if not is_flax_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCamelCase        =     [
           '''FlaxViTForImageClassification''',
           '''FlaxViTModel''',
           '''FlaxViTPreTrainedModel''',
       ]

if TYPE_CHECKING:
       from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig, ViTOnnxConfig

       try:
              if not is_vision_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .feature_extraction_vit import ViTFeatureExtractor
              from .image_processing_vit import ViTImageProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_vit import (
                  VIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  ViTForImageClassification,
                  ViTForMaskedImageModeling,
                  ViTModel,
                  ViTPreTrainedModel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_vit import TFViTForImageClassification, TFViTModel, TFViTPreTrainedModel

       try:
              if not is_flax_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_flax_vit import FlaxViTForImageClassification, FlaxViTModel, FlaxViTPreTrainedModel


else:
       import sys

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



