
"""simple docstring"""

def 							A						(    snake_case				:int    , snake_case				:int    , snake_case				:int		)				->     int:

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






def 							A						(    snake_case				:int = 1_7_7_7    , snake_case				:int = 1_8_5_5    , snake_case				:int = 8		)				->     int:
 __UpperCamelCase      =	base
 for _ in range(1    , snake_case		):
  __UpperCamelCase      =	_modexpt(snake_case    , snake_case    , 1_0**digits		)

 return result


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





"""simple docstring"""

from typing import Union

import fire
import torch
from tqdm import tqdm






def 							A						(    snake_case				:str    , snake_case				:str = "cpu"    , snake_case				:Union[str, None] = None		)				->     None:
 __UpperCamelCase      =	torch.load(snake_case    , map_location=snake_case		)
 for k, v in tqdm(state_dict.items()		):
  if not isinstance(snake_case    , torch.Tensor		):
   raise TypeError('FP16 conversion only works on paths that are saved state dicts, like pytorch_model.bin'		)
  __UpperCamelCase      =	v.half()
 if save_path is None:  # overwrite src_path
  __UpperCamelCase      =	src_path
 torch.save(snake_case    , snake_case		)


if __name__ == "__main__":
      fire.Fire(convert)



