
"""simple docstring"""






import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


UpperCAmelCase        =				re.compile(r"""^(?P<major>\d+)""" r"""\.(?P<minor>\d+)""" r"""\.(?P<patch>\d+)$""")



@total_ordering
@dataclass
class 			lowercase					:
			lowercase        =     42
			lowercase        =     None
			lowercase        =     None
			lowercase        =     None
			lowercase        =     None






			def 					UpperCAmelCase							(self  :	List[Any]			)       ->	Dict:





				"""simple docstring"""


				lowerCAmelCase												=  _str_to_version_tuple(self.version_str			)






			def __repr__(self  :	Union[str, Any]			)       ->	Union[str, Any]:





				"""simple docstring"""


				return F"""{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}"""






			@property
			def 					UpperCAmelCase							(self  :	Optional[Any]			)       ->	Any:





				"""simple docstring"""


				return self.major, self.minor, self.patch






			def 					UpperCAmelCase							(self  :	Any      ,SCREAMING_SNAKE_CASE_  :	Tuple			)       ->	Dict:





				"""simple docstring"""


				if isinstance(__snake_case      ,__snake_case			):
					return Version(__snake_case			)
				elif isinstance(__snake_case      ,__snake_case			):
					return other
				raise TypeError(F"""{other} (type {type(__snake_case			)}) cannot be compared to version."""			)






			def __eq__(self  :	Optional[Any]      ,SCREAMING_SNAKE_CASE_  :	Any			)       ->	List[Any]:





				"""simple docstring"""


				try:
					lowerCAmelCase												=  self._validate_operand(__snake_case			)
				except (TypeError, ValueError):
					return False
				else:
					return self.tuple == other.tuple






			def __lt__(self  :	int      ,SCREAMING_SNAKE_CASE_  :	int			)       ->	Dict:





				"""simple docstring"""


				lowerCAmelCase												=  self._validate_operand(__snake_case			)
				return self.tuple < other.tuple






			def __hash__(self  :	List[str]			)       ->	int:





				"""simple docstring"""


				return hash(_version_tuple_to_str(self.tuple			)			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	str      ,SCREAMING_SNAKE_CASE_  :	str			)       ->	List[Any]:





				"""simple docstring"""


				lowerCAmelCase												=  {f.name for f in dataclasses.fields(cls			)}
				return cls(**{k: v for k, v in dic.items() if k in field_names}			)






			def 					UpperCAmelCase							(self  :	Dict			)       ->	int:





				"""simple docstring"""


				return self.version_str





def __magic_name__	(				_lowerCamelCase:		List[str]			)					->						int:

	'''simple docstring'''




	lowerCAmelCase												=  _VERSION_REG.match(SCREAMING_SNAKE_CASE__			)
	if not res:
		raise ValueError(F"""Invalid version '{version_str}'. Format should be x.y.z with {{x,y,z}} being digits."""			)
	return tuple(int(SCREAMING_SNAKE_CASE__			) for v in [res.group('''major'''			), res.group('''minor'''			), res.group('''patch'''			)]			)




def __magic_name__	(				_lowerCamelCase:		str			)					->						int:

	'''simple docstring'''




	return ".".join(str(SCREAMING_SNAKE_CASE__			) for v in version_tuple			)






'''simple docstring'''


from typing import TYPE_CHECKING

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


UpperCAmelCase_						:  Dict				  =						{
    'configuration_mobilebert': [
        'MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'MobileBertConfig',
        'MobileBertOnnxConfig',
    ],
    'tokenization_mobilebert': ['MobileBertTokenizer'],
}

try:
				if not is_tokenizers_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  Optional[Any]				  =						['MobileBertTokenizerFast']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  Optional[Any]				  =						[
				    'MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'MobileBertForMaskedLM',
				    'MobileBertForMultipleChoice',
				    'MobileBertForNextSentencePrediction',
				    'MobileBertForPreTraining',
				    'MobileBertForQuestionAnswering',
				    'MobileBertForSequenceClassification',
				    'MobileBertForTokenClassification',
				    'MobileBertLayer',
				    'MobileBertModel',
				    'MobileBertPreTrainedModel',
				    'load_tf_weights_in_mobilebert',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  List[str]				  =						[
				    'TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'TFMobileBertForMaskedLM',
				    'TFMobileBertForMultipleChoice',
				    'TFMobileBertForNextSentencePrediction',
				    'TFMobileBertForPreTraining',
				    'TFMobileBertForQuestionAnswering',
				    'TFMobileBertForSequenceClassification',
				    'TFMobileBertForTokenClassification',
				    'TFMobileBertMainLayer',
				    'TFMobileBertModel',
				    'TFMobileBertPreTrainedModel',
				]


if TYPE_CHECKING:
				from .configuration_mobilebert import (
				    MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
				    MobileBertConfig,
				    MobileBertOnnxConfig,
				)
				from .tokenization_mobilebert import MobileBertTokenizer

				try:
								if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_mobilebert_fast import MobileBertTokenizerFast

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_mobilebert import (
								    MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    MobileBertForMaskedLM,
								    MobileBertForMultipleChoice,
								    MobileBertForNextSentencePrediction,
								    MobileBertForPreTraining,
								    MobileBertForQuestionAnswering,
								    MobileBertForSequenceClassification,
								    MobileBertForTokenClassification,
								    MobileBertLayer,
								    MobileBertModel,
								    MobileBertPreTrainedModel,
								    load_tf_weights_in_mobilebert,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_mobilebert import (
								    TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFMobileBertForMaskedLM,
								    TFMobileBertForMultipleChoice,
								    TFMobileBertForNextSentencePrediction,
								    TFMobileBertForPreTraining,
								    TFMobileBertForQuestionAnswering,
								    TFMobileBertForSequenceClassification,
								    TFMobileBertForTokenClassification,
								    TFMobileBertMainLayer,
								    TFMobileBertModel,
								    TFMobileBertPreTrainedModel,
								)

else:
				import sys

				UpperCAmelCase_						:  str				  =						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




