



"""simple docstring"""





from typing import TYPE_CHECKING

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


__lowerCAmelCase							:       List[str]          =       {
    '''configuration_mobilevit''': ['''MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MobileViTConfig''', '''MobileViTOnnxConfig'''],
}

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase							:       str          =       ['''MobileViTFeatureExtractor''']
					__lowerCAmelCase							:       Optional[int]          =       ['''MobileViTImageProcessor''']

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase							:       Optional[int]          =       [
					    '''MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''MobileViTForImageClassification''',
					    '''MobileViTForSemanticSegmentation''',
					    '''MobileViTModel''',
					    '''MobileViTPreTrainedModel''',
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase							:       Union[str, Any]          =       [
					    '''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

					__lowerCAmelCase							:       Tuple          =       _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)








def 						A_							(	_lowerCAmelCase				,  _lowerCAmelCase	)		->					Optional[int]:
 UpperCamelCase      :   List[Any]			      =  [1]
 for i in range(2				,  _lowerCAmelCase	):
  factorials.append(factorials[-1] * i	)
 assert 0 <= k < factorials[-1] * n, "k out of bounds"

 UpperCamelCase      :   Tuple			      =  []
 UpperCamelCase      :   str			      =  list(range(_lowerCAmelCase	)	)

 # Find permutation
 while factorials:
  UpperCamelCase      :   int			      =  factorials.pop()
  UpperCamelCase      ,       UpperCamelCase      :   int			      =  divmod(_lowerCAmelCase				,  _lowerCAmelCase	)
  permutation.append(elements[number]	)
  elements.remove(elements[number]	)
 permutation.append(elements[0]	)

 return permutation


if __name__ == "__main__":
    import doctest

    doctest.testmod()
