'''simple docstring'''


# Lint as: python3
import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


__lowerCAmelCase	:       Optional[int]						       =	re.compile(r"^(?P<major>\d+)" r"\.(?P<minor>\d+)" r"\.(?P<patch>\d+)$")






@total_ordering
@dataclass
class 						A   :
							a_        =      42
							a_        =      None
							a_        =      None
							a_        =      None
							a_        =      None





							def       snake_case__						(      self				:							str	)							->	Tuple:
								__UpperCAmelCase				,			__UpperCAmelCase				,			__UpperCAmelCase							=			_str_to_version_tuple(self.version_str	)





							def __repr__(      self				:							List[Any]	)							->	Optional[Any]:
								return f"""{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}"""





							@property
							def       snake_case__						(      self				:							Dict	)							->	Union[str, Any]:
								return self.major, self.minor, self.patch





							def       snake_case__						(      self				:							int     ,		__a				:							List[str]	)							->	Dict:
								if isinstance(__a     ,		__a	):
									return Version(__a	)
								elif isinstance(__a     ,		__a	):
									return other
								raise TypeError(f"""{other} (type {type(__a	)}) cannot be compared to version."""	)





							def __eq__(      self				:							Any     ,		__a				:							Tuple	)							->	Tuple:
								try:
									__UpperCAmelCase							=			self._validate_operand(__a	)
								except (TypeError, ValueError):
									return False
								else:
									return self.tuple == other.tuple





							def __lt__(      self				:							Optional[int]     ,		__a				:							str	)							->	Union[str, Any]:
								__UpperCAmelCase							=			self._validate_operand(__a	)
								return self.tuple < other.tuple





							def __hash__(      self				:							int	)							->	Optional[int]:
								return hash(_version_tuple_to_str(self.tuple	)	)





							@classmethod
							def       snake_case__						(      cls				:							List[Any]     ,		__a				:							List[str]	)							->	Union[str, Any]:
								__UpperCAmelCase							=			{f.name for f in dataclasses.fields(cls	)}
								return cls(**{k: v for k, v in dic.items() if k in field_names}	)






							def       snake_case__						(      self				:							Union[str, Any]	)							->	str:
								return self.version_str





def       lowerCAmelCase					(		UpperCamelCase__				:   List[str]       ):


	"""simple docstring"""
	__UpperCAmelCase							=			_VERSION_REG.match(UpperCamelCase__       )
	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(UpperCamelCase__       ) for v in [res.group('''major'''       ), res.group('''minor'''       ), res.group('''patch'''       )]       )





def       lowerCAmelCase					(		UpperCamelCase__				:   List[Any]       ):


	"""simple docstring"""
	return ".".join(str(UpperCamelCase__       ) for v in version_tuple       )

'''simple docstring'''


from typing import TYPE_CHECKING

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


__lowerCAmelCase	:       List[Any]						       =	{
    "configuration_audio_spectrogram_transformer": [
        "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "ASTConfig",
    ]
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase	:       str						       =	[
					    "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "ASTForAudioClassification",
					    "ASTModel",
					    "ASTPreTrainedModel",
					]

try:
					if not is_speech_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase	:       Union[str, Any]						       =	["ASTFeatureExtractor"]

if TYPE_CHECKING:
					from .configuration_audio_spectrogram_transformer import (
					    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    ASTConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_audio_spectrogram_transformer import (
										    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    ASTForAudioClassification,
										    ASTModel,
										    ASTPreTrainedModel,
										)

					try:
										if not is_speech_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
					import sys

					__lowerCAmelCase	:       Optional[Any]						       =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
