
"""simple docstring"""


from __future__ import annotations






def    lowercase	(  lowerCAmelCase__  ,lowerCAmelCase__  ,lowerCAmelCase__	):
			assert n > 1 and a > 0 and greatest_common_divisor(lowerCAmelCase__  ,lowerCAmelCase__	) == 1
			((lowerCamelCase_)		,   (lowerCamelCase_)		,   (lowerCamelCase_)) 		=     extended_gcd(lowerCAmelCase__  ,lowerCAmelCase__	)  # Implemented below
			lowerCamelCase_ 		=     (b * s) % n
			return x






def    lowercase	(  lowerCAmelCase__  ,lowerCAmelCase__	):
			((lowerCamelCase_)		,   (lowerCamelCase_)) 		=     extended_euclid(lowerCAmelCase__  ,lowerCAmelCase__	)  # Implemented below
			if b < 0:
						lowerCamelCase_ 		=     (b % n + n) % n
			return b






def    lowercase	(  lowerCAmelCase__  ,lowerCAmelCase__  ,lowerCAmelCase__	):
			lowerCamelCase_ 		=     invert_modulo(lowerCAmelCase__  ,lowerCAmelCase__	)
			lowerCamelCase_ 		=     (b * s) % n
			return x






def    lowercase	(  lowerCAmelCase__  ,lowerCAmelCase__	):
			assert a >= 0 and b >= 0

			if b == 0:
						lowerCamelCase_		,   lowerCamelCase_		,   lowerCamelCase_ 		=     a, 1, 0
			else:
						((lowerCamelCase_)		,   (lowerCamelCase_)		,   (lowerCamelCase_)) 		=     extended_gcd(lowerCAmelCase__  ,a % b	)
						lowerCamelCase_ 		=     q
						lowerCamelCase_ 		=     p - q * (a // b)

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

			return (d, x, y)






def    lowercase	(  lowerCAmelCase__  ,lowerCAmelCase__	):
			if b == 0:
						return (1, 0)
			((lowerCamelCase_)		,   (lowerCamelCase_)) 		=     extended_euclid(lowerCAmelCase__  ,a % b	)
			lowerCamelCase_ 		=     a // b
			return (y, x - k * y)






def    lowercase	(  lowerCAmelCase__  ,lowerCAmelCase__	):
			if a < b:
						lowerCamelCase_		,   lowerCamelCase_ 		=     b, a

			while a % b != 0:
						lowerCamelCase_		,   lowerCamelCase_ 		=     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_						       =				{
    """configuration_flava""": [
        """FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """FlavaConfig""",
        """FlavaImageCodebookConfig""",
        """FlavaImageConfig""",
        """FlavaMultimodalConfig""",
        """FlavaTextConfig""",
    ],
}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_						       =				["""FlavaFeatureExtractor"""]
						A_						       =				["""FlavaImageProcessor"""]
						A_						       =				["""FlavaProcessor"""]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_						       =				[
						    """FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """FlavaForPreTraining""",
						    """FlavaImageCodebook""",
						    """FlavaImageModel""",
						    """FlavaModel""",
						    """FlavaMultimodalModel""",
						    """FlavaPreTrainedModel""",
						    """FlavaTextModel""",
						]

if TYPE_CHECKING:
						from .configuration_flava import (
						    FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    FlavaConfig,
						    FlavaImageCodebookConfig,
						    FlavaImageConfig,
						    FlavaMultimodalConfig,
						    FlavaTextConfig,
						)

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_flava import FlavaFeatureExtractor
												from .image_processing_flava import FlavaImageProcessor
												from .processing_flava import FlavaProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_flava import (
												    FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST,
												    FlavaForPreTraining,
												    FlavaImageCodebook,
												    FlavaImageModel,
												    FlavaModel,
												    FlavaMultimodalModel,
												    FlavaPreTrainedModel,
												    FlavaTextModel,
												)

else:
						import sys

						A_						       =				_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



