





"""simple docstring"""





from __future__ import annotations
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->tuple[int, int]:





  """simple docstring"""


  if b == 0:
    return (1, 0)
  ((lowerCAmelCase__)				,							(lowerCAmelCase__))     :Optional[Any]											=				extended_euclid(_SCREAMING_SNAKE_CASE	,  a % b     )
  lowerCAmelCase__     :int											=				a // b
  return (y, x - k * y)
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->int:





  """simple docstring"""


  ((lowerCAmelCase__)				,							(lowerCAmelCase__))     :List[Any]											=				extended_euclid(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  lowerCAmelCase__     :List[str]											=				na * na
  lowerCAmelCase__     :int											=				ra * x * na + ra * y * na
  return (n % m + m) % m
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->int:





  """simple docstring"""


  ((lowerCAmelCase__)				,							(lowerCAmelCase__))     :int											=				extended_euclid(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  if b < 0:
    lowerCAmelCase__     :Tuple											=				(b % n + n) % n
  return b
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->int:





  """simple docstring"""


  lowerCAmelCase__				,							lowerCAmelCase__     :List[str]											=				invert_modulo(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     ), invert_modulo(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  lowerCAmelCase__     :Union[str, Any]											=				na * na
  lowerCAmelCase__     :int											=				ra * x * na + ra * y * na
  return (n % m + m) % m


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

  testmod(name="""chinese_remainder_theorem""", verbose=True)
  testmod(name="""chinese_remainder_theorem2""", verbose=True)
  testmod(name="""invert_modulo""", verbose=True)
  testmod(name="""extended_euclid""", verbose=True)







"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__A											=						{"""configuration_sew""": ["""SEW_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SEWConfig"""]}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A											=						[
      """SEW_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """SEWForCTC""",
      """SEWForSequenceClassification""",
      """SEWModel""",
      """SEWPreTrainedModel""",
  ]

if TYPE_CHECKING:
  from .configuration_sew import SEW_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_sew import (
        SEW_PRETRAINED_MODEL_ARCHIVE_LIST,
        SEWForCTC,
        SEWForSequenceClassification,
        SEWModel,
        SEWPreTrainedModel,
    )


else:
  import sys

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