'''simple docstring'''




from typing import List

from .keymap import KEYMAP, get_character

def _lowercase	(      lowerCamelCase__						)					->       Optional[int]:





       """simple docstring"""


       def decorator(lowerCamelCase__						):
              __UpperCAmelCase  :				Dict       				=		getattr(lowerCamelCase__							,    "handle_key"							,    []						)
              handle += [key]
              setattr(lowerCamelCase__							,    "handle_key"							,    lowerCamelCase__						)
              return func

       return decorator

def _lowercase	(      *lowerCamelCase__						)					->       str:





       """simple docstring"""


       def decorator(lowerCamelCase__						):
              __UpperCAmelCase  :				Dict       				=		getattr(lowerCamelCase__							,    "handle_key"							,    []						)
              handle += keys
              setattr(lowerCamelCase__							,    "handle_key"							,    lowerCamelCase__						)
              return func

       return decorator






class 		__A       (__magic_name__   ):






       def __new__(      cls				,     UpperCamelCase_				,     UpperCamelCase_				,     UpperCamelCase_      ):
              __UpperCAmelCase  :				Union[str, Any]       				=		super().__new__(cls				,     UpperCamelCase_				,     UpperCamelCase_				,     UpperCamelCase_      )
              if not hasattr(UpperCamelCase_				,     "key_handler"      ):
                     setattr(UpperCamelCase_				,     "key_handler"				,     {}      )
              setattr(UpperCamelCase_				,     "handle_input"				,     KeyHandler.handle_input      )

              for value in attrs.values():
                     __UpperCAmelCase  :				List[Any]       				=		getattr(UpperCamelCase_				,     "handle_key"				,     []      )
                     for key in handled_keys:
                            __UpperCAmelCase  :				Dict       				=		value
              return new_cls







       @staticmethod
       def 			_snake_case						(      cls      ):
              __UpperCAmelCase  :				str       				=		get_character()
              if char != KEYMAP["undefined"]:
                     __UpperCAmelCase  :				Tuple       				=		ord(UpperCamelCase_      )
              __UpperCAmelCase  :				str       				=		cls.key_handler.get(UpperCamelCase_      )
              if handler:
                     __UpperCAmelCase  :				List[str]       				=		char
                     return handler(cls      )
              else:
                     return None





def _lowercase	(      cls						)					->       str:





       """simple docstring"""


       return KeyHandler(cls.__name__							,    cls.__bases__							,    cls.__dict__.copy()						)







'''simple docstring'''




from typing import TYPE_CHECKING

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


_a   :	str 							=   {"configuration_vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig", "ViTOnnxConfig"]}

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _a   :	str 							=   ["ViTFeatureExtractor"]
   _a   :	Dict 							=   ["ViTImageProcessor"]

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

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _a   :	List[str] 							=   [
       "TFViTForImageClassification",
       "TFViTModel",
       "TFViTPreTrainedModel",
   ]

try:
   if not is_flax_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _a   :	Dict 							=   [
       "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

   _a   :	Dict 							=   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






