


from __future__ import annotations







def 						_lowercase       (     __lowerCamelCase			:					int		,__lowerCamelCase			:					int		,__lowerCamelCase			:					int			)  ->   tuple[float, float]:





     '''simple docstring'''





     assert (
         c % greatest_common_divisor(__lowerCamelCase		,__lowerCamelCase			) == 0
     )  # greatest_common_divisor(a,b) function implemented below
     ((UpperCamelCase__)	,(UpperCamelCase__)	,(UpperCamelCase__))							:  Union[str, Any]								=     extended_gcd(__lowerCamelCase		,__lowerCamelCase			)  # extended_gcd(a,b) function implemented below
     UpperCamelCase__							:  List[Any]								=     c / d
     return (r * x, r * y)







def 						_lowercase       (     __lowerCamelCase			:					int		,__lowerCamelCase			:					int		,__lowerCamelCase			:					int		,__lowerCamelCase			:					int = 2			)  ->   None:





     '''simple docstring'''





     ((UpperCamelCase__)	,(UpperCamelCase__))							:  int								=     diophantine(__lowerCamelCase		,__lowerCamelCase		,__lowerCamelCase			)  # Initial value
     UpperCamelCase__							:  List[Any]								=     greatest_common_divisor(__lowerCamelCase		,__lowerCamelCase			)
     UpperCamelCase__							:  str								=     a // d
     UpperCamelCase__							:  Any								=     b // d

     for i in range(__lowerCamelCase			):
          UpperCamelCase__							:  int								=     xa + i * q
          UpperCamelCase__							:  Optional[int]								=     ya - i * p
          print(__lowerCamelCase		,__lowerCamelCase			)







def 						_lowercase       (     __lowerCamelCase			:					int		,__lowerCamelCase			:					int			)  ->   int:





     '''simple docstring'''





     if a < b:
          UpperCamelCase__	,UpperCamelCase__							:  Tuple								=     b, a

     while a % b != 0:
          UpperCamelCase__	,UpperCamelCase__							:  Union[str, Any]								=     b, a % b

     return b







def 						_lowercase       (     __lowerCamelCase			:					int		,__lowerCamelCase			:					int			)  ->   tuple[int, int, int]:





     '''simple docstring'''





     assert a >= 0 and b >= 0

     if b == 0:
          UpperCamelCase__	,UpperCamelCase__	,UpperCamelCase__							:  List[str]								=     a, 1, 0
     else:
          ((UpperCamelCase__)	,(UpperCamelCase__)	,(UpperCamelCase__))							:  int								=     extended_gcd(__lowerCamelCase		,a % b			)
          UpperCamelCase__							:  Any								=     q
          UpperCamelCase__							:  str								=     p - q * (a // b)

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

     return (d, x, y)


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

   testmod(name="""diophantine""", verbose=True)
   testmod(name="""diophantine_all_soln""", verbose=True)
   testmod(name="""extended_gcd""", verbose=True)
   testmod(name="""greatest_common_divisor""", verbose=True)








from typing import TYPE_CHECKING

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


_SCREAMING_SNAKE_CASE :					Optional[Any]			=	{
    """configuration_layoutlm""": ["""LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LayoutLMConfig""", """LayoutLMOnnxConfig"""],
    """tokenization_layoutlm""": ["""LayoutLMTokenizer"""],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _SCREAMING_SNAKE_CASE :					Dict			=	["""LayoutLMTokenizerFast"""]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _SCREAMING_SNAKE_CASE :					List[str]			=	[
       """LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """LayoutLMForMaskedLM""",
       """LayoutLMForSequenceClassification""",
       """LayoutLMForTokenClassification""",
       """LayoutLMForQuestionAnswering""",
       """LayoutLMModel""",
       """LayoutLMPreTrainedModel""",
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _SCREAMING_SNAKE_CASE :					str			=	[
       """TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """TFLayoutLMForMaskedLM""",
       """TFLayoutLMForSequenceClassification""",
       """TFLayoutLMForTokenClassification""",
       """TFLayoutLMForQuestionAnswering""",
       """TFLayoutLMMainLayer""",
       """TFLayoutLMModel""",
       """TFLayoutLMPreTrainedModel""",
   ]


if TYPE_CHECKING:
   from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig, LayoutLMOnnxConfig
   from .tokenization_layoutlm import LayoutLMTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_layoutlm_fast import LayoutLMTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_layoutlm import (
          LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST,
          LayoutLMForMaskedLM,
          LayoutLMForQuestionAnswering,
          LayoutLMForSequenceClassification,
          LayoutLMForTokenClassification,
          LayoutLMModel,
          LayoutLMPreTrainedModel,
      )
   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_layoutlm import (
          TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFLayoutLMForMaskedLM,
          TFLayoutLMForQuestionAnswering,
          TFLayoutLMForSequenceClassification,
          TFLayoutLMForTokenClassification,
          TFLayoutLMMainLayer,
          TFLayoutLMModel,
          TFLayoutLMPreTrainedModel,
      )

else:
   import sys

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




