


"""simple docstring"""


def   snake_case						(				_a:     int							)->		int:
      '''simple docstring'''


      lowerCamelCase__           =		abs(_a							)
      lowerCamelCase__           =		0
      while n > 0:
            res += n % 10
            n //= 10
      return res



def   snake_case						(				_a:     int							)->		int:
      '''simple docstring'''


      lowerCamelCase__           =		abs(_a							)
      return n if n < 10 else n % 10 + sum_of_digits(n // 10							)



def   snake_case						(				_a:     int							)->		int:
      '''simple docstring'''


      return sum(int(_a							) for c in str(abs(_a							)							)							)



def   snake_case						(				)->		None:
      '''simple docstring'''


      from collections.abc import Callable
      from timeit import timeit

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

      for value in (262144, 1125899906842624, 1267650600228229401496703205376):
            for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
                  benchmark_a_function(_a		,   _a							)
            print()


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   benchmark()







"""simple docstring"""


def   snake_case						(				_a:     list[list[float]]							)->		list[list[float]]:
      '''simple docstring'''


      lowerCamelCase__           =		[]
      for data in source_data:
            for i, el in enumerate(_a							):
                  if len(_a							) < i + 1:
                        data_lists.append([]							)
                  data_lists[i].append(float(_a							)							)
      return data_lists



def   snake_case						(				_a:     list[list[float]]		,   _a:     list[int]							)->		list[list[float]]:
      '''simple docstring'''


      lowerCamelCase__           =		[]
      for dlist, weight in zip(_a		,   _a							):
            lowerCamelCase__           =		min(_a							)
            lowerCamelCase__           =		max(_a							)

            lowerCamelCase__           =		[]
            # for weight 0 score is 1 - actual score
            if weight == 0:
                  for item in dlist:
                        try:
                              score.append(1 - ((item - mind) / (maxd - mind))							)
                        except ZeroDivisionError:
                              score.append(1							)

            elif weight == 1:
                  for item in dlist:
                        try:
                              score.append((item - mind) / (maxd - mind)							)
                        except ZeroDivisionError:
                              score.append(0							)

        # weight not 0 or 1
            else:
                  lowerCamelCase__           =		F'Invalid weight of {weight:f} provided'
                  raise ValueError(_a							)

            score_lists.append(_a							)

      return score_lists



def   snake_case						(				_a:     list[list[float]]							)->		list[float]:
      '''simple docstring'''


      lowerCamelCase__           =		[0 for i in range(len(score_lists[0]							)							)]

      for slist in score_lists:
            for j, ele in enumerate(_a							):
                  lowerCamelCase__           =		final_scores[j] + ele

      return final_scores






def   snake_case						(				_a:     list[list[float]]		,   _a:     list[int]							)->		list[list[float]]:
      '''simple docstring'''


      lowerCamelCase__           =		get_data(_a							)
      lowerCamelCase__           =		calculate_each_score(_a		,   _a							)
      lowerCamelCase__           =		generate_final_scores(_a							)

      # append scores to source data
      for i, ele in enumerate(_a							):
            source_data[i].append(_a							)

      return source_data



