"""simple docstring"""


def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""

  if not all(char in """01""" for char in bin_string		):
    raise ValueError("""Non-binary value was passed to the function"""		)
  if not bin_string:
    raise ValueError("""Empty string was passed to the function"""		)
  _UpperCAmelCase						 =      """"""
  while len(UpperCAmelCase__		) % 3 != 0:
    _UpperCAmelCase						 =      """0""" + bin_string
  _UpperCAmelCase						 =      [
      bin_string[index : index + 3]
      for index in range(len(UpperCAmelCase__		)		)
      if index % 3 == 0
  ]
  for bin_group in bin_string_in_3_list:
    _UpperCAmelCase						 =      0
    for index, val in enumerate(UpperCAmelCase__		):
      oct_val += int(2 ** (2 - index) * int(UpperCAmelCase__		)		)
    oct_string += str(UpperCAmelCase__		)
  return oct_string


if __name__ == "__main__":
    from doctest import testmod

    testmod()

"""simple docstring"""


def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      abs(lowercase		)
  _UpperCAmelCase						 =      0
  while n > 0:
    res += n % 10
    n //= 10
  return res






def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      abs(lowercase		)
  return n if n < 10 else n % 10 + sum_of_digits(n // 10		)






def     __UpperCAmelCase					(			lowercase		):







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






def     __UpperCAmelCase					(			):







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

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

  for value in (26_21_44, 11_25_89_99_06_84_26_24, 1_26_76_50_60_02_28_22_94_01_49_67_03_20_53_76):
    for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
      benchmark_a_function(lowercase   ,lowercase		)
    print()


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()
