code: 
  
  
  
  
  
  
  """simple docstring"""
  from __future__ import annotations
  
  
  def        A	(							__snake_case:   Dict   ,    __snake_case:   Optional[Any]   ,    __snake_case:   int     )						->		int:
  
         """simple docstring"""
  
  
  
  
  
         assert n > 1 and a > 0 and greatest_common_divisor(__snake_case   ,    __snake_case     ) == 1
         ((__magic_name__)							,     (__magic_name__)							,     (__magic_name__))										=						extended_gcd(__snake_case   ,    __snake_case     )  # Implemented below
         __magic_name__										=						(b * s) % n
         return x
  
  
  def        A	(							__snake_case:   List[str]   ,    __snake_case:   List[str]     )						->		int:
  
         """simple docstring"""
  
  
  
  
  
         ((__magic_name__)							,     (__magic_name__))										=						extended_euclid(__snake_case   ,    __snake_case     )  # Implemented below
         if b < 0:
                __magic_name__										=						(b % n + n) % n
         return b
  
  
  def        A	(							__snake_case:   Tuple   ,    __snake_case:   List[str]   ,    __snake_case:   List[Any]     )						->		int:
  
         """simple docstring"""
  
  
  
  
  
         __magic_name__										=						invert_modulo(__snake_case   ,    __snake_case     )
         __magic_name__										=						(b * s) % n
         return x
  
  
  def        A	(							__snake_case:   Tuple   ,    __snake_case:   Tuple     )						->		tuple[int, int, int]:
  
         """simple docstring"""
  
  
  
  
  
         assert a >= 0 and b >= 0
  
         if b == 0:
                __magic_name__							,     __magic_name__							,     __magic_name__										=						a, 1, 0
         else:
                ((__magic_name__)							,     (__magic_name__)							,     (__magic_name__))										=						extended_gcd(__snake_case   ,    a % b     )
                __magic_name__										=						q
                __magic_name__										=						p - q * (a // b)
  
         assert a % d == 0 and b % d == 0
         assert d == a * x + b * y
  
         return (d, x, y)
  
  
  def        A	(							__snake_case:   Optional[Any]   ,    __snake_case:   int     )						->		tuple[int, int]:
  
         """simple docstring"""
  
  
  
  
  
         if b == 0:
                return (1, 0)
         ((__magic_name__)							,     (__magic_name__))										=						extended_euclid(__snake_case   ,    a % b     )
         __magic_name__										=						a // b
         return (y, x - k * y)
  
  
  def        A	(							__snake_case:   int   ,    __snake_case:   str     )						->		int:
  
         """simple docstring"""
  
  
  
  
  
         if a < b:
                __magic_name__							,     __magic_name__										=						b, a
  
         while a % b != 0:
                __magic_name__							,     __magic_name__										=						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)
  
  
style_context: 
  
  
  
  
  
  
  """simple docstring"""
  from typing import TYPE_CHECKING
  
  from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available
  
  
  snake_case   :   Optional[int]    		=		{
      """configuration_splinter""": ["""SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SplinterConfig"""],
      """tokenization_splinter""": ["""SplinterTokenizer"""],
  }
  
  try:
   if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   snake_case   :   Dict    		=		["""SplinterTokenizerFast"""]
  
  try:
   if not is_torch_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   snake_case   :   Dict    		=		[
       """SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """SplinterForQuestionAnswering""",
       """SplinterForPreTraining""",
       """SplinterLayer""",
       """SplinterModel""",
       """SplinterPreTrainedModel""",
   ]
  
  
  if TYPE_CHECKING:
   from .configuration_splinter import SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP, SplinterConfig
   from .tokenization_splinter import SplinterTokenizer
  
   try:
    if not is_tokenizers_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .tokenization_splinter_fast import SplinterTokenizerFast
  
   try:
    if not is_torch_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .modeling_splinter import (
        SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST,
        SplinterForPreTraining,
        SplinterForQuestionAnswering,
        SplinterLayer,
        SplinterModel,
        SplinterPreTrainedModel,
    )
  
  
  else:
   import sys
  
   snake_case   :   List[str]    		=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)