
from typing import TYPE_CHECKING

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


lowerCamelCase_						     =					{'''configuration_swin''': ['''SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''SwinConfig''', '''SwinOnnxConfig''']}


try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCamelCase_						     =					[
        '''SWIN_PRETRAINED_MODEL_ARCHIVE_LIST''',
        '''SwinForImageClassification''',
        '''SwinForMaskedImageModeling''',
        '''SwinModel''',
        '''SwinPreTrainedModel''',
        '''SwinBackbone''',
    ]

try:
    if not is_tf_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCamelCase_						     =					[
        '''TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST''',
        '''TFSwinForImageClassification''',
        '''TFSwinForMaskedImageModeling''',
        '''TFSwinModel''',
        '''TFSwinPreTrainedModel''',
    ]

if TYPE_CHECKING:
    from .configuration_swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig, SwinOnnxConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_swin import (
            SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
            SwinBackbone,
            SwinForImageClassification,
            SwinForMaskedImageModeling,
            SwinModel,
            SwinPreTrainedModel,
        )

    try:
        if not is_tf_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_tf_swin import (
            TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
            TFSwinForImageClassification,
            TFSwinForMaskedImageModeling,
            TFSwinModel,
            TFSwinPreTrainedModel,
        )

else:
    import sys

    lowerCamelCase_						     =					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)







def 						__magic_name__			(   __a      :	int	,		__a      :	int						):



     '''simple docstring'''




     while a != 0:
          UpperCamelCase__		,	UpperCamelCase__				=    b % a, a
     return b






def 						__magic_name__			(   __a      :	int	,		__a      :	int						):



     '''simple docstring'''




     if gcd(__a	,		__a						) != 1:
          UpperCamelCase__				=    f"mod inverse of {a!r} and {m!r} does not exist"
          raise ValueError(__a						)
     UpperCamelCase__		,	UpperCamelCase__		,	UpperCamelCase__				=    1, 0, a
     UpperCamelCase__		,	UpperCamelCase__		,	UpperCamelCase__				=    0, 1, m
     while va != 0:
          UpperCamelCase__				=    ua // va
          UpperCamelCase__		,	UpperCamelCase__		,	UpperCamelCase__		,	UpperCamelCase__		,	UpperCamelCase__		,	UpperCamelCase__				=    (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
     return ua % m





