




'''simple docstring'''





from __future__ import annotations





def UpperCAmelCase						(					UpperCAmelCase_      ,  UpperCAmelCase_      ,  UpperCAmelCase_	):
    assert n > 1 and a > 0 and greatest_common_divisor(UpperCAmelCase_      ,  UpperCAmelCase_	) == 1
    ((_a)					,   (_a)					,   (_a))							:       List[str]       					=			extended_gcd(UpperCAmelCase_      ,  UpperCAmelCase_	)  # Implemented below
    _a							:       List[Any]       					=			(b * s) % n
    return x





def UpperCAmelCase						(					UpperCAmelCase_      ,  UpperCAmelCase_	):
    ((_a)					,   (_a))							:       List[str]       					=			extended_euclid(UpperCAmelCase_      ,  UpperCAmelCase_	)  # Implemented below
    if b < 0:
        _a							:       Tuple       					=			(b % n + n) % n
    return b





def UpperCAmelCase						(					UpperCAmelCase_      ,  UpperCAmelCase_      ,  UpperCAmelCase_	):
    _a							:       Tuple       					=			invert_modulo(UpperCAmelCase_      ,  UpperCAmelCase_	)
    _a							:       List[str]       					=			(b * s) % n
    return x





def UpperCAmelCase						(					UpperCAmelCase_      ,  UpperCAmelCase_	):
    assert a >= 0 and b >= 0

    if b == 0:
        _a					,   _a					,   _a							:       Dict       					=			a, 1, 0
    else:
        ((_a)					,   (_a)					,   (_a))							:       Any       					=			extended_gcd(UpperCAmelCase_      ,  a % b	)
        _a							:       List[Any]       					=			q
        _a							:       List[str]       					=			p - q * (a // b)

    assert a % d == 0 and b % d == 0
    assert d == a * x + b * y

    return (d, x, y)





def UpperCAmelCase						(					UpperCAmelCase_      ,  UpperCAmelCase_	):
    if b == 0:
        return (1, 0)
    ((_a)					,   (_a))							:       Union[str, Any]       					=			extended_euclid(UpperCAmelCase_      ,  a % b	)
    _a							:       Optional[int]       					=			a // b
    return (y, x - k * y)





def UpperCAmelCase						(					UpperCAmelCase_      ,  UpperCAmelCase_	):
    if a < b:
        _a					,   _a							:       List[Any]       					=			b, a

    while a % b != 0:
        _a					,   _a							:       Dict       					=			b, a % b

    return b


if __name__ == "__main__":
  from doctest import testmod

  testmod(name='''modular_division''', verbose=True)
  testmod(name='''modular_division2''', verbose=True)
  testmod(name='''invert_modulo''', verbose=True)
  testmod(name='''extended_gcd''', verbose=True)
  testmod(name='''extended_euclid''', verbose=True)
  testmod(name='''greatest_common_divisor''', verbose=True)








'''simple docstring'''





from typing import TYPE_CHECKING

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


a		:  Dict   			=			{
    '''configuration_mobilevitv2''': [
        '''MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''MobileViTV2Config''',
        '''MobileViTV2OnnxConfig''',
    ],
}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a		:  List[str]   			=			[
      '''MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''MobileViTV2ForImageClassification''',
      '''MobileViTV2ForSemanticSegmentation''',
      '''MobileViTV2Model''',
      '''MobileViTV2PreTrainedModel''',
  ]

if TYPE_CHECKING:
  from .configuration_mobilevitva import (
      MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP,
      MobileViTVaConfig,
      MobileViTVaOnnxConfig,
  )

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_mobilevitva import (
        MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
        MobileViTVaForImageClassification,
        MobileViTVaForSemanticSegmentation,
        MobileViTVaModel,
        MobileViTVaPreTrainedModel,
    )

else:
  import sys

  a		:  Dict   			=			_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


