





import logging
import os

from .state import PartialState
class     SCREAMING_SNAKE_CASE       (logging.LoggerAdapter				):


   @staticmethod
   def 	SCREAMING_SNAKE_CASE_							(   a      :    Any	)->       Union[str, Any]:





     """simple docstring"""







     lowercase__           =  PartialState()
     return not main_process_only or (main_process_only and state.is_main_process)


   def 	SCREAMING_SNAKE_CASE_							(   self      :    List[Any]      ,					a      :    Tuple      ,					a      :    str      ,					*a      :    str      ,					**a      :    str	)->       int:





     """simple docstring"""







     if PartialState._shared_state == {}:
       raise RuntimeError(
           'You must initialize the accelerate state by calling either `PartialState()` or `Accelerator()` before using the logging utility.'	)
     lowercase__           =  kwargs.pop('main_process_only'      ,					a	)
     lowercase__           =  kwargs.pop('in_order'      ,					a	)

     if self.isEnabledFor(a	):
       if self._should_log(a	):
         lowercase__      ,   lowercase__           =  self.process(a      ,					a	)
         self.logger.log(a      ,					a      ,					*a      ,					**a	)

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






def       __UpperCamelCase  (_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE = None		)    ->       Optional[Any]:
  if log_level is None:
    lowercase__           =  os.environ.get('ACCELERATE_LOG_LEVEL'		,						_SCREAMING_SNAKE_CASE		)
  lowercase__           =  logging.getLogger(_SCREAMING_SNAKE_CASE		)
  if log_level is not None:
    logger.setLevel(log_level.upper()		)
    logger.root.setLevel(log_level.upper()		)
  return MultiProcessAdapter(_SCREAMING_SNAKE_CASE		,						{}		)









def       __UpperCamelCase  (_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE		)    ->       int:

  if exponent == 1:
    return base
  if exponent % 2 == 0:
    lowercase__           =  _modexpt(_SCREAMING_SNAKE_CASE		,						exponent // 2		,						_SCREAMING_SNAKE_CASE		) % modulo_value
    return (x * x) % modulo_value
  else:
    return (base * _modexpt(_SCREAMING_SNAKE_CASE		,						exponent - 1		,						_SCREAMING_SNAKE_CASE		)) % modulo_value




def       __UpperCamelCase  (_SCREAMING_SNAKE_CASE = 1777		,						_SCREAMING_SNAKE_CASE = 1855		,						_SCREAMING_SNAKE_CASE = 8		)    ->       int:
  lowercase__           =  base
  for _ in range(1		,						_SCREAMING_SNAKE_CASE		):
    lowercase__           =  _modexpt(_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE		,						10**digits		)

  return result


if __name__ == "__main__":
      print(f'''{solution() = }''')


