




import os

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

from .logging import get_logger


_lowerCAmelCase  :				Optional[Any]						=				2 << 2_0  # 2mb
_lowerCAmelCase  :				Any						=				get_logger(__name__)
class      _UpperCamelCase (			lowerCAmelCase						):
      def 		UpperCAmelCase_  (     self				:Tuple )       ->     str:
       UpperCAmelCase__								=  self._options.get_all_options().get("runner" )
       return runner in [None, "DirectRunner", "PortableRunner"]



def   lowerCAmelCase						(						_lowerCAmelCase							:				List[Any]  ,							_lowerCAmelCase							:				Any  ,							_lowerCAmelCase							:				int=False		):




 """simple docstring"""







 UpperCAmelCase__								=  FileSystems
 if fs.exists(_lowerCAmelCase		):
  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(_lowerCAmelCase		) as remote_file:
  with open(_lowerCAmelCase  ,							"rb"		) as local_file:
   UpperCAmelCase__								=  local_file.read(_lowerCAmelCase		)
   while chunk:
    remote_file.write(_lowerCAmelCase		)
    UpperCAmelCase__								=  local_file.read(_lowerCAmelCase		)



def   lowerCAmelCase						(						_lowerCAmelCase							:				List[str]  ,							_lowerCAmelCase							:				int  ,							_lowerCAmelCase							:				Union[str, Any]=False		):




 """simple docstring"""







 UpperCAmelCase__								=  FileSystems
 if os.path.exists(_lowerCAmelCase		):
  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(_lowerCAmelCase		) as remote_file:
  with open(_lowerCAmelCase  ,							"wb"		) as local_file:
   UpperCAmelCase__								=  remote_file.read(_lowerCAmelCase		)
   while chunk:
    local_file.write(_lowerCAmelCase		)
    UpperCAmelCase__								=  remote_file.read(_lowerCAmelCase		)











def   lowerCAmelCase						(						_lowerCAmelCase							:				int  ,							_lowerCAmelCase							:				int		):




 """simple docstring"""







 if a < b:
  return gcd(_lowerCAmelCase  ,							_lowerCAmelCase		)
 if a % b == 0:
  return b
 return gcd(_lowerCAmelCase  ,							a % b		)



def   lowerCAmelCase						(						_lowerCAmelCase							:				int  ,							_lowerCAmelCase							:				int  ,							_lowerCAmelCase							:				int		):




 """simple docstring"""







 if y == 0:
  return 1
 UpperCAmelCase__								=  power(_lowerCAmelCase  ,							y // 2  ,							_lowerCAmelCase		) % mod
 UpperCAmelCase__								=  (temp * temp) % mod
 if y % 2 == 1:
  UpperCAmelCase__								=  (temp * x) % mod
 return temp



def   lowerCAmelCase						(						_lowerCAmelCase							:				int		):




 """simple docstring"""







 UpperCAmelCase__								=  2
 while b < n:
  if gcd(_lowerCAmelCase  ,							_lowerCAmelCase		) == 1 and power(_lowerCAmelCase  ,							n - 1  ,							_lowerCAmelCase		) != 1:
   return False
  b += 1
 return True


if __name__ == "__main__":
  _lowerCAmelCase  :				Dict						=				int(input("Enter number: ").strip())
  if is_carmichael_number(number):
    print(F'''{number} is a Carmichael Number.''')
  else:
    print(F'''{number} is not a Carmichael Number.''')





