
'''simple docstring'''





import os
import unittest

import pytest
from parameterized import parameterized

from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device


# skipping in unittest tests

a__						:				List[Any]           =    [(1,)]





def     snake_case							(						)->     Union[str, Any]:







      """simple docstring"""
      __A    		=     bool(os.getenv('RUN_SLOW' ,					0		)		)
      if run_slow:
            assert True
      else:
            assert False, "should have been skipped"





def     snake_case							(						)->     int:







      """simple docstring"""
      __A    		=     bool(os.getenv('RUN_SLOW' ,					0		)		)
      if run_slow and torch_device == "cuda":
            assert True
      else:
            assert False, "should have been skipped"


@require_torch
class 	UpperCamelCase__					(      unittest.TestCase):






 @slow
 @require_torch_gpu
 def 		lowercase_  (     self					:Any     )			->     List[Any]:







       '''simple docstring'''



       check_slow_torch_cuda()






 @require_torch_gpu
 @slow
 def 		lowercase_  (     self					:Tuple     )			->     Union[str, Any]:







       '''simple docstring'''



       check_slow_torch_cuda()






 @parameterized.expand(lowercase__     )
 @slow
 def 		lowercase_  (     self					:Dict		,			_A					:int=None     )			->     Tuple:







       '''simple docstring'''



       check_slow()





@slow
@require_torch_gpu
def     snake_case							(						)->     List[str]:







      """simple docstring"""
      check_slow_torch_cuda()





@require_torch_gpu
@slow
def     snake_case							(						)->     List[Any]:







      """simple docstring"""
      check_slow_torch_cuda()





@slow
@pytest.mark.parametrize('param' ,					[1]		)
def     snake_case							(						UpperCAmelCase		)->     List[Any]:







      """simple docstring"""
      check_slow()





@pytest.mark.parametrize('param' ,					[1]		)
@slow
def     snake_case							(						UpperCAmelCase		)->     Any:







      """simple docstring"""
      check_slow()








'''simple docstring'''





from __future__ import annotations





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase ,					UpperCAmelCase		)->     tuple[float, float]:







      """simple docstring"""
      assert (
          c % greatest_common_divisor(UpperCAmelCase ,					UpperCAmelCase		) == 0
      )  # greatest_common_divisor(a,b) function implemented below
      ((__A)		, (__A)		, (__A))    		=     extended_gcd(UpperCAmelCase ,					UpperCAmelCase		)  # extended_gcd(a,b) function implemented below
      __A    		=     c / d
      return (r * x, r * y)





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase ,					UpperCAmelCase ,					UpperCAmelCase = 2		)->     None:







      """simple docstring"""
      ((__A)		, (__A))    		=     diophantine(UpperCAmelCase ,					UpperCAmelCase ,					UpperCAmelCase		)  # Initial value
      __A    		=     greatest_common_divisor(UpperCAmelCase ,					UpperCAmelCase		)
      __A    		=     a // d
      __A    		=     b // d

      for i in range(UpperCAmelCase		):
            __A    		=     xa + i * q
            __A    		=     ya - i * p
            print(UpperCAmelCase ,					UpperCAmelCase		)





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase		)->     int:







      """simple docstring"""
      if a < b:
            __A		, __A    		=     b, a

      while a % b != 0:
            __A		, __A    		=     b, a % b

      return b





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase		)->     tuple[int, int, int]:







      """simple docstring"""
      assert a >= 0 and b >= 0

      if b == 0:
            __A		, __A		, __A    		=     a, 1, 0
      else:
            ((__A)		, (__A)		, (__A))    		=     extended_gcd(UpperCAmelCase ,					a % b		)
            __A    		=     q
            __A    		=     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)






