


'''simple docstring'''




def   _a		(lowercase__			:   int						)			->			Union[str, Any]:






     """simple docstring"""
     __snake_case           =						abs(__snake_case						)
     __snake_case           =						0
     while n > 0:
          res += n % 1_0
          n //= 1_0
     return res





def   _a		(lowercase__			:   int						)			->			List[str]:






     """simple docstring"""
     __snake_case           =						abs(__snake_case						)
     return n if n < 1_0 else n % 1_0 + sum_of_digits(n // 1_0						)





def   _a		(lowercase__			:   int						)			->			Any:






     """simple docstring"""
     return sum(int(__snake_case						) for c in str(abs(__snake_case						)						)						)





def   _a		()			->			int:






     """simple docstring"""
     from collections.abc import Callable
     from timeit import timeit

     def benchmark_a_function(lowercase__			:   Callable							,   lowercase__			:   int						) -> None:
          __snake_case           =						f'{func.__name__}({value})'
          __snake_case           =						timeit(f'__main__.{call}'							,   setup='import __main__'						)
          print(f'{call:56} = {func(__snake_case						)} -- {timing:.4f} seconds'						)

     for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
          for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
               benchmark_a_function(__snake_case							,   __snake_case						)
          print()


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       benchmark()





'''simple docstring'''






_UpperCAmelCase    :     Any         =       '''0.21.0'''

from .accelerator import Accelerator
from .big_modeling import (
    cpu_offload,
    cpu_offload_with_hook,
    disk_offload,
    dispatch_model,
    init_empty_weights,
    init_on_device,
    load_checkpoint_and_dispatch,
)
from .data_loader import skip_first_batches
from .launchers import debug_launcher, notebook_launcher
from .state import PartialState
from .utils import (
    DeepSpeedPlugin,
    DistributedDataParallelKwargs,
    DistributedType,
    FullyShardedDataParallelPlugin,
    GradScalerKwargs,
    InitProcessGroupKwargs,
    find_executable_batch_size,
    infer_auto_device_map,
    is_rich_available,
    load_checkpoint_in_model,
    synchronize_rng_states,
)


if is_rich_available():
   from .utils import rich



