'''simple docstring'''





from timeit import timeit




def       lowerCAmelCase_     (		lowercase:							int		)    ->				int:







 '''simple docstring'''
 if number < 0:
  raise ValueError('''the value of input must not be negative'''		)
 _UpperCamelCase:     List[Any]							= 0
 while number:
  number &= number - 1
  result += 1
 return result




def       lowerCAmelCase_     (		lowercase:							int		)    ->				int:







 '''simple docstring'''
 if number < 0:
  raise ValueError('''the value of input must not be negative'''		)
 _UpperCamelCase:     Any							= 0
 while number:
  if number % 2 == 1:
   result += 1
  number >>= 1
 return result




def       lowerCAmelCase_     (		)    ->				None:







 '''simple docstring'''

 def do_benchmark(lowercase:							int		) -> None:
  _UpperCamelCase:     str							= '''import __main__ as z'''
  print(F"""Benchmark when {number = }:"""		)
  print(F"""{get_set_bits_count_using_modulo_operator(lowercase		) = }"""		)
  _UpperCamelCase:     List[Any]							= timeit('''z.get_set_bits_count_using_modulo_operator(25)'''  ,					setup=lowercase		)
  print(F"""timeit() runs in {timing} seconds"""		)
  print(F"""{get_set_bits_count_using_brian_kernighans_algorithm(lowercase		) = }"""		)
  _UpperCamelCase:     Union[str, Any]							= timeit(
      '''z.get_set_bits_count_using_brian_kernighans_algorithm(25)'''  ,					setup=lowercase  ,					)
  print(F"""timeit() runs in {timing} seconds"""		)

 for number in (25, 37, 58, 0):
  do_benchmark(lowercase		)
  print()


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  benchmark()
from __future__ import annotations




def       lowerCAmelCase_     (		lowercase:							int = 4		)    ->				list[list[int]]:







 '''simple docstring'''
 _UpperCamelCase:     Dict							= abs(lowercase		) or 4
 return [[1 + x + y * row_size for x in range(lowercase		)] for y in range(lowercase		)]




def       lowerCAmelCase_     (		lowercase:							list[list[int]]		)    ->				list[list[int]]:







 '''simple docstring'''
 return reverse_row(transpose(lowercase		)		)
 # OR.. transpose(reverse_column(matrix))




def       lowerCAmelCase_     (		lowercase:							list[list[int]]		)    ->				list[list[int]]:







 '''simple docstring'''
 return reverse_row(reverse_column(lowercase		)		)
 # OR.. reverse_column(reverse_row(matrix))




def       lowerCAmelCase_     (		lowercase:							list[list[int]]		)    ->				list[list[int]]:







 '''simple docstring'''
 return reverse_column(transpose(lowercase		)		)
 # OR.. transpose(reverse_row(matrix))




def       lowerCAmelCase_     (		lowercase:							list[list[int]]		)    ->				list[list[int]]:







 '''simple docstring'''
 _UpperCamelCase:     int							= [list(lowercase		) for x in zip(*lowercase		)]
 return matrix




def       lowerCAmelCase_     (		lowercase:							list[list[int]]		)    ->				list[list[int]]:







 '''simple docstring'''
 _UpperCamelCase:     str							= matrix[::-1]
 return matrix




def       lowerCAmelCase_     (		lowercase:							list[list[int]]		)    ->				list[list[int]]:







 '''simple docstring'''
 _UpperCamelCase:     str							= [x[::-1] for x in matrix]
 return matrix




def       lowerCAmelCase_     (		lowercase:							list[list[int]]		)    ->				None:







 '''simple docstring'''
 for i in matrix:
  print(*lowercase		)


if __name__ == "__main__":
  UpperCAmelCase_			    =							make_matrix()
  print('''\norigin:\n''')
  print_matrix(matrix)
  print('''\nrotate 90 counterclockwise:\n''')
  print_matrix(rotate_aa(matrix))

  UpperCAmelCase_			    =							make_matrix()
  print('''\norigin:\n''')
  print_matrix(matrix)
  print('''\nrotate 180:\n''')
  print_matrix(rotate_aaa(matrix))

  UpperCAmelCase_			    =							make_matrix()
  print('''\norigin:\n''')
  print_matrix(matrix)
  print('''\nrotate 270 counterclockwise:\n''')
  print_matrix(rotate_aaa(matrix))