




"""simple docstring"""

from __future__ import annotations



def 				a (						__snake_case     :				int  ):



				'''simple docstring'''





				assert (
				    isinstance(__snake_case,    __snake_case  ) and mask > 0
				), f'mask needs to be positive integer, your input {mask}'
				UpperCAmelCase_					:Dict      			=      []
				UpperCAmelCase_					:Any      			=      mask

				while submask:
								all_submasks.append(__snake_case  )
								UpperCAmelCase_					:List[str]      			=      (submask - 1) & mask

				return all_submasks


if __name__ == "__main__":
						import doctest

						doctest.testmod()











"""simple docstring"""

def 				a (						__snake_case     :				int  ):



				'''simple docstring'''





				if not isinstance(__snake_case,    __snake_case  ) or number < 0:
								raise ValueError('''Input must be a non-negative integer'''  )

				UpperCAmelCase_					:Optional[Any]      			=      number & ~(number - 1)
				UpperCAmelCase_					:List[str]      			=      0
				while intermediate:
								intermediate >>= 1
								index += 1
				return index - 1


if __name__ == "__main__":
						import doctest

						doctest.testmod(verbose=True)


