


'''simple docstring'''






import logging
import os

from .state import PartialState




class 	a__       (							logging.LoggerAdapter						):





							'''simple docstring'''






							@staticmethod
							def 						__SCREAMING_SNAKE_CASE							(	lowerCamelCase_     ) ->							Tuple:
														lowerCAmelCase__      =			PartialState()
														return not main_process_only or (main_process_only and state.is_main_process)







							def 						__SCREAMING_SNAKE_CASE							(	self      ,					lowerCamelCase_      ,					lowerCamelCase_      ,					*lowerCamelCase_      ,					**lowerCamelCase_     ) ->							int:
														if PartialState._shared_state == {}:
																					raise RuntimeError(
																					    '''You must initialize the accelerate state by calling either `PartialState()` or `Accelerator()` before using the logging utility.'''     )
														lowerCAmelCase__      =			kwargs.pop('''main_process_only'''      ,					lowerCamelCase_     )
														lowerCAmelCase__      =			kwargs.pop('''in_order'''      ,					lowerCamelCase_     )

														if self.isEnabledFor(lowerCamelCase_     ):
																					if self._should_log(lowerCamelCase_     ):
																												lowerCAmelCase__     ,      lowerCAmelCase__      =			self.process(lowerCamelCase_      ,					lowerCamelCase_     )
																												self.logger.log(lowerCamelCase_      ,					lowerCamelCase_      ,					*lowerCamelCase_      ,					**lowerCamelCase_     )

																					elif in_order:
																												lowerCAmelCase__      =			PartialState()
																												for i in range(state.num_processes     ):
																																			if i == state.process_index:
																																										lowerCAmelCase__     ,      lowerCAmelCase__      =			self.process(lowerCamelCase_      ,					lowerCamelCase_     )
																																										self.logger.log(lowerCamelCase_      ,					lowerCamelCase_      ,					*lowerCamelCase_      ,					**lowerCamelCase_     )
																																			state.wait_for_everyone()


def       _snake_case     (  A				,					A = None )		->					Any:
							if log_level is None:
														lowerCAmelCase__      =			os.environ.get('''ACCELERATE_LOG_LEVEL'''				,					A )
							lowerCAmelCase__      =			logging.getLogger(A )
							if log_level is not None:
														logger.setLevel(log_level.upper() )
														logger.root.setLevel(log_level.upper() )
							return MultiProcessAdapter(A				,					{} )



'''simple docstring'''






def       _snake_case     (  A )		->					int:
							return 1 if digit in (0, 1) else (digit * factorial(digit - 1 ))


def       _snake_case     (  A )		->					bool:
							lowerCAmelCase__      =			0
							lowerCAmelCase__      =			number
							while duplicate > 0:
														lowerCAmelCase__     ,      lowerCAmelCase__      =			divmod(A				,					10 )
														fact_sum += factorial(A )
							return fact_sum == number


if __name__ == "__main__":
		print('''Program to check whether a number is a Krisnamurthy Number or not.''')
		__UpperCAmelCase					       =							int(input('''Enter number: ''').strip())
		print(
		    f"""{number} is {'' if krishnamurthy(number) else 'not '}a Krishnamurthy Number."""
		)