






'''simple docstring'''





from __future__ import annotations






def  lowerCamelCase_  (     lowercase__					,  lowercase__					,  lowercase__):
 assert (
     c % greatest_common_divisor(SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_) == 0
 )  # greatest_common_divisor(a,b) function implemented below
 (lowerCamelCase__)	=  extended_gcd(SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_)  # extended_gcd(a,b) function implemented below
 lowerCamelCase__	=  c / d
 return (r * x, r * y)






def  lowerCamelCase_  (     lowercase__					,  lowercase__					,  lowercase__					,  lowercase__ = 2):
 (lowerCamelCase__)	=  diophantine(SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_)  # Initial value
 lowerCamelCase__	=  greatest_common_divisor(SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_)
 lowerCamelCase__	=  a // d
 lowerCamelCase__	=  b // d

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






def  lowerCamelCase_  (     lowercase__					,  lowercase__):





 if a < b:
  lowerCamelCase__	=  b, a

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

 return b






def  lowerCamelCase_  (     lowercase__					,  lowercase__):
 assert a >= 0 and b >= 0

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





import os

from apache_beam.io.filesystems import FileSystems
from apache_beam.pipeline import Pipeline

from .logging import get_logger


__UpperCAmelCase			:			Optional[Any]			      =					2 << 20  # 2mb
__UpperCAmelCase			:			List[Any]			      =					get_logger(__name__)



class  UpperCAmelCase_						(				_a):
       '''simple docstring'''






       def 			_lowercase (  self    ):




              """simple docstring"""




              UpperCamelCase     :						Optional[Any] 						=		self._options.get_all_options().get('''runner'''    )
              return runner in [None, "DirectRunner", "PortableRunner"]




def   a						(				SCREAMING_SNAKE_CASE_   :		str				,      SCREAMING_SNAKE_CASE_   :		int				,      SCREAMING_SNAKE_CASE_   :		Optional[Any]=False							):






       """simple docstring"""





       UpperCamelCase     :						int 						=		FileSystems
       if fs.exists(SCREAMING_SNAKE_CASE_							):
              if force_upload:
                     logger.info(F"""Remote path already exist: {remote_file_path}. Overwriting it as force_upload=True."""							)
              else:
                     logger.info(F"""Remote path already exist: {remote_file_path}. Skipping it as force_upload=False."""							)
                     return
       with fs.create(SCREAMING_SNAKE_CASE_							) as remote_file:
              with open(SCREAMING_SNAKE_CASE_				,      '''rb'''							) as local_file:
                     UpperCamelCase     :						List[str] 						=		local_file.read(SCREAMING_SNAKE_CASE_							)
                     while chunk:
                            remote_file.write(SCREAMING_SNAKE_CASE_							)
                            UpperCamelCase     :						Any 						=		local_file.read(SCREAMING_SNAKE_CASE_							)


def   a						(				SCREAMING_SNAKE_CASE_   :		str				,      SCREAMING_SNAKE_CASE_   :		Optional[Any]				,      SCREAMING_SNAKE_CASE_   :		List[str]=False							):






       """simple docstring"""





       UpperCamelCase     :						List[Any] 						=		FileSystems
       if os.path.exists(SCREAMING_SNAKE_CASE_							):
              if force_download:
                     logger.info(F"""Local path already exist: {remote_file_path}. Overwriting it as force_upload=True."""							)
              else:
                     logger.info(F"""Local path already exist: {remote_file_path}. Skipping it as force_upload=False."""							)
                     return
       with fs.open(SCREAMING_SNAKE_CASE_							) as remote_file:
              with open(SCREAMING_SNAKE_CASE_				,      '''wb'''							) as local_file:
                     UpperCamelCase     :						List[str] 						=		remote_file.read(SCREAMING_SNAKE_CASE_							)
                     while chunk:
                            local_file.write(SCREAMING_SNAKE_CASE_							)
                            UpperCamelCase     :						str 						=		remote_file.read(SCREAMING_SNAKE_CASE_							)

