
"""simple docstring"""







from typing import List

from .keymap import KEYMAP, get_character
def   __UpperCamelCase   (					SCREAMING_SNAKE_CASE )  ->     List[Any]:







							"""simple docstring"""


							def decorator(SCREAMING_SNAKE_CASE ):
														__snake_case     			=       getattr(SCREAMING_SNAKE_CASE_							,    "handle_key"							,    [] )
														handle += [key]
														setattr(SCREAMING_SNAKE_CASE_							,    "handle_key"							,    SCREAMING_SNAKE_CASE_ )
														return func

							return decorator
def   __UpperCamelCase   (					*SCREAMING_SNAKE_CASE )  ->     List[Any]:







							"""simple docstring"""


							def decorator(SCREAMING_SNAKE_CASE ):
														__snake_case     			=       getattr(SCREAMING_SNAKE_CASE_							,    "handle_key"							,    [] )
														handle += keys
														setattr(SCREAMING_SNAKE_CASE_							,    "handle_key"							,    SCREAMING_SNAKE_CASE_ )
														return func

							return decorator







class 							__magic_name__     (		_UpperCAmelCase   ):





					def __new__(				cls   :							Any							,						snake_case_   :							Tuple							,						snake_case_   :							Dict							,						snake_case_   :							Union[str, Any]    ):
												__snake_case     			=       super().__new__(cls							,						lowercase__							,						lowercase__							,						lowercase__    )
												if not hasattr(lowercase__							,						"key_handler"    ):
																			setattr(lowercase__							,						"key_handler"							,						{}    )
												setattr(lowercase__							,						"handle_input"							,						KeyHandler.handle_input    )

												for value in attrs.values():
																			__snake_case     			=       getattr(lowercase__							,						"handle_key"							,						[]    )
																			for key in handled_keys:
																										__snake_case     			=       value
												return new_cls





					@staticmethod
					def 							lowerCAmelCase      (				cls   :							List[Any]    ):
												__snake_case     			=       get_character()
												if char != KEYMAP["undefined"]:
																			__snake_case     			=       ord(lowercase__    )
												__snake_case     			=       cls.key_handler.get(lowercase__    )
												if handler:
																			__snake_case     			=       char
																			return handler(cls    )
												else:
																			return None




def   __UpperCamelCase   (					cls )  ->     Optional[Any]:







							"""simple docstring"""


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


"""simple docstring"""







from typing import TYPE_CHECKING

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


_SCREAMING_SNAKE_CASE	       =      {
    """configuration_mobilevit""": ["""MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MobileViTConfig""", """MobileViTOnnxConfig"""],
}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_SCREAMING_SNAKE_CASE	       =      ["""MobileViTFeatureExtractor"""]
		_SCREAMING_SNAKE_CASE	       =      ["""MobileViTImageProcessor"""]

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_SCREAMING_SNAKE_CASE	       =      [
		    """MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """MobileViTForImageClassification""",
		    """MobileViTForSemanticSegmentation""",
		    """MobileViTModel""",
		    """MobileViTPreTrainedModel""",
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_SCREAMING_SNAKE_CASE	       =      [
		    """TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """TFMobileViTForImageClassification""",
		    """TFMobileViTForSemanticSegmentation""",
		    """TFMobileViTModel""",
		    """TFMobileViTPreTrainedModel""",
		]

if TYPE_CHECKING:
		from .configuration_mobilevit import MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTConfig, MobileViTOnnxConfig

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_mobilevit import MobileViTFeatureExtractor
				from .image_processing_mobilevit import MobileViTImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_mobilevit import (
				    MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    MobileViTForImageClassification,
				    MobileViTForSemanticSegmentation,
				    MobileViTModel,
				    MobileViTPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_mobilevit import (
				    TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFMobileViTForImageClassification,
				    TFMobileViTForSemanticSegmentation,
				    TFMobileViTModel,
				    TFMobileViTPreTrainedModel,
				)


else:
		import sys

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