

'''simple docstring'''

from __future__ import annotations





def 				A_					(	snake_case ,    snake_case ,    snake_case	):
  assert n > 1 and a > 0 and greatest_common_divisor(snake_case ,    snake_case	) == 1
  (SCREAMING_SNAKE_CASE):Union[str, Any]   =   extended_gcd(snake_case ,    snake_case	)  # Implemented below
  SCREAMING_SNAKE_CASE:Dict   =   (b * s) % n
  return x





def 				A_					(	snake_case ,    snake_case	):
  (SCREAMING_SNAKE_CASE):str   =   extended_euclid(snake_case ,    snake_case	)  # Implemented below
  if b < 0:
    SCREAMING_SNAKE_CASE:Any   =   (b % n + n) % n
  return b





def 				A_					(	snake_case ,    snake_case ,    snake_case	):
  SCREAMING_SNAKE_CASE:str   =   invert_modulo(snake_case ,    snake_case	)
  SCREAMING_SNAKE_CASE:Dict   =   (b * s) % n
  return x





def 				A_					(	snake_case ,    snake_case	):
  assert a >= 0 and b >= 0

  if b == 0:
    SCREAMING_SNAKE_CASE:List[Any]   =   a, 1, 0
  else:
    (SCREAMING_SNAKE_CASE):Any   =   extended_gcd(snake_case ,    a % b	)
    SCREAMING_SNAKE_CASE:Tuple   =   q
    SCREAMING_SNAKE_CASE:List[str]   =   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 ,    snake_case	):
  if b == 0:
    return (1, 0)
  (SCREAMING_SNAKE_CASE):int   =   extended_euclid(snake_case ,    a % b	)
  SCREAMING_SNAKE_CASE:Optional[int]   =   a // b
  return (y, x - k * y)





def 				A_					(	snake_case ,    snake_case	):
  if a < b:
    SCREAMING_SNAKE_CASE:List[str]   =   b, a

  while a % b != 0:
    SCREAMING_SNAKE_CASE:Dict   =   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)









'''simple docstring'''

import unittest
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import Mock, patch

import diffusers.utils.hub_utils





class 							_snake_case	(    unittest.TestCase  ):
   @patch("diffusers.utils.hub_utils.get_full_repo_name"							)
   def       __UpperCamelCase  (	self     : List[str]       ,SCREAMING_SNAKE_CASE__     : Mock							):
     SCREAMING_SNAKE_CASE:Optional[Any]   =   "full_repo_name"
     with TemporaryDirectory() as tmpdir:
       # Dummy args values
       SCREAMING_SNAKE_CASE:int   =   Mock()
       SCREAMING_SNAKE_CASE:int   =   tmpdir
       SCREAMING_SNAKE_CASE:Optional[Any]   =   0
       SCREAMING_SNAKE_CASE:Union[str, Any]   =   "hub_token"
       SCREAMING_SNAKE_CASE:str   =   "dataset_name"
       SCREAMING_SNAKE_CASE:Tuple   =   0.01
       SCREAMING_SNAKE_CASE:str   =   100_000
       SCREAMING_SNAKE_CASE:Optional[Any]   =   10_000
       SCREAMING_SNAKE_CASE:List[Any]   =   0.01
       SCREAMING_SNAKE_CASE:Union[str, Any]   =   0.02
       SCREAMING_SNAKE_CASE:Optional[Any]   =   0.03
       SCREAMING_SNAKE_CASE:Tuple   =   0.0_005
       SCREAMING_SNAKE_CASE:List[str]   =   0.000_001
       SCREAMING_SNAKE_CASE:Optional[int]   =   1
       SCREAMING_SNAKE_CASE:Optional[int]   =   10
       SCREAMING_SNAKE_CASE:Any   =   0.001
       SCREAMING_SNAKE_CASE:Optional[int]   =   0.1
       SCREAMING_SNAKE_CASE:Union[str, Any]   =   0.2
       SCREAMING_SNAKE_CASE:Optional[Any]   =   True

       # Model card mush be rendered and saved
       diffusers.utils.hub_utils.create_model_card(SCREAMING_SNAKE_CASE__       ,model_name="model_name"							)
       self.assertTrue((Path(SCREAMING_SNAKE_CASE__							) / "README.md").is_file()							)






