

from __future__ import annotations

def 			snake_case__    (					SCREAMING_SNAKE_CASE_	:					int			,  SCREAMING_SNAKE_CASE_	:					int			,  SCREAMING_SNAKE_CASE_	:					int    ):



     '''simple docstring'''





     assert (
         c % greatest_common_divisor(SCREAMING_SNAKE_CASE_			,  SCREAMING_SNAKE_CASE_    ) == 0
     )  # greatest_common_divisor(a,b) function implemented below
     ((lowercase__)   ,				(lowercase__)   ,				(lowercase__))					:     List[Any]   = extended_gcd(SCREAMING_SNAKE_CASE_			,  SCREAMING_SNAKE_CASE_    )  # extended_gcd(a,b) function implemented below
     lowercase__					:     Optional[int]   = c / d
     return (r * x, r * y)

def 			snake_case__    (					SCREAMING_SNAKE_CASE_	:					int			,  SCREAMING_SNAKE_CASE_	:					int			,  SCREAMING_SNAKE_CASE_	:					int			,  SCREAMING_SNAKE_CASE_	:					int = 2    ):



     '''simple docstring'''





     ((lowercase__)   ,				(lowercase__))					:     int   = diophantine(SCREAMING_SNAKE_CASE_			,  SCREAMING_SNAKE_CASE_			,  SCREAMING_SNAKE_CASE_    )  # Initial value
     lowercase__					:     Any   = greatest_common_divisor(SCREAMING_SNAKE_CASE_			,  SCREAMING_SNAKE_CASE_    )
     lowercase__					:     int   = a // d
     lowercase__					:     str   = b // d

     for i in range(SCREAMING_SNAKE_CASE_    ):
          lowercase__					:     Union[str, Any]   = xa + i * q
          lowercase__					:     List[Any]   = ya - i * p
          print(SCREAMING_SNAKE_CASE_			,  SCREAMING_SNAKE_CASE_    )

def 			snake_case__    (					SCREAMING_SNAKE_CASE_	:					int			,  SCREAMING_SNAKE_CASE_	:					int    ):



     '''simple docstring'''





     if a < b:
          lowercase__   ,				lowercase__					:     List[str]   = b, a

     while a % b != 0:
          lowercase__   ,				lowercase__					:     Tuple   = b, a % b

     return b

def 			snake_case__    (					SCREAMING_SNAKE_CASE_	:					int			,  SCREAMING_SNAKE_CASE_	:					int    ):



     '''simple docstring'''





     assert a >= 0 and b >= 0

     if b == 0:
          lowercase__   ,				lowercase__   ,				lowercase__					:     Optional[Any]   = a, 1, 0
     else:
          ((lowercase__)   ,				(lowercase__)   ,				(lowercase__))					:     Tuple   = extended_gcd(SCREAMING_SNAKE_CASE_			,  a % b    )
          lowercase__					:     List[Any]   = q
          lowercase__					:     Dict   = 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 transformers.models.cpm.tokenization_cpm import CpmTokenizer
from transformers.testing_utils import custom_tokenizers

from ..xlnet.test_modeling_xlnet import XLNetModelTest


@custom_tokenizers
class    SCREAMING_SNAKE_CASE__      (__snake_case  ):





    def    snake_case_       (   self		,     a		,     a		,     a		,     a		,     a):
         return True





    def    snake_case_       (   self):
         lowercase__					:     Tuple   = CpmTokenizer.from_pretrained('TsinghuaAI/CPM-Generate')
         lowercase__					:     str   = 'Hugging Face大法好，谁用谁知道。'
         lowercase__					:     Optional[int]   = 'Hugging Face大法好,谁用谁知道。<unk>'
         lowercase__					:     Any   = '▁Hu gg ing ▁ ▂ ▁F ace ▁大法 ▁好 ▁ , ▁谁 ▁用 ▁谁 ▁知 道 ▁ 。'.split()

         lowercase__					:     Any   = tokenizer.tokenize(a)
         self.assertListEqual(a		,     a)

         lowercase__					:     List[Any]   = tokens + [tokenizer.unk_token]

         lowercase__					:     Any   = [1_3789, 1_3283, 1421, 8, 10, 1164, 1_3608, 1_6528, 63, 8, 9, 440, 108, 440, 121, 90, 8, 12, 0]
         self.assertListEqual(tokenizer.convert_tokens_to_ids(a)		,     a)

         lowercase__					:     Optional[Any]   = tokenizer.decode(a)
         self.assertEqual(a		,     a)

