code: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  from __future__ import annotations
  
  
  
  
  def 	__lowerCamelCase (  UpperCAmelCase_       )      ->list[int]:
  	if not list_of_ints:
  		return []
  
  	if min(UpperCAmelCase_       ) < 0:
  		raise ValueError('All numbers must be positive'       )
  
  	snake_case__  					=      max(len(bin(UpperCAmelCase_       )[2:]       ) for x in list_of_ints       )
  	return _msd_radix_sort(UpperCAmelCase_				,							UpperCAmelCase_       )
  
  
  
  
  def 	__lowerCamelCase (  UpperCAmelCase_				,							UpperCAmelCase_       )      ->list[int]:
  	if bit_position == 0 or len(UpperCAmelCase_       ) in [0, 1]:
  		return list_of_ints
  
  	snake_case__  					=      []
  	snake_case__  					=      []
  	# Split numbers based on bit at bit_position from the right
  	for number in list_of_ints:
  		if (number >> (bit_position - 1)) & 1:
  			# number has a one at bit bit_position
  			ones.append(UpperCAmelCase_       )
  		else:
  			# number has a zero at bit bit_position
  			zeros.append(UpperCAmelCase_       )
  
      # recursively split both lists further
  	snake_case__  					=      _msd_radix_sort(UpperCAmelCase_				,							bit_position - 1       )
  	snake_case__  					=      _msd_radix_sort(UpperCAmelCase_				,							bit_position - 1       )
  
  	# recombine lists
  	snake_case__  					=      zeros
  	res.extend(UpperCAmelCase_       )
  
  	return res
  
  
  
  
  def 	__lowerCamelCase (  UpperCAmelCase_       )      ->List[str]:
  	snake_case__  					=      len(UpperCAmelCase_       )
  	if not list_of_ints or length == 1:
  		return
  
  	if min(UpperCAmelCase_       ) < 0:
  		raise ValueError('All numbers must be positive'       )
  
  	snake_case__  					=      max(len(bin(UpperCAmelCase_       )[2:]       ) for x in list_of_ints       )
  	_msd_radix_sort_inplace(UpperCAmelCase_				,							UpperCAmelCase_				,							0				,							UpperCAmelCase_       )
  
  
  
  
  def 	__lowerCamelCase (  UpperCAmelCase_				,							UpperCAmelCase_				,							UpperCAmelCase_				,							UpperCAmelCase_       )      ->Tuple:
  	if bit_position == 0 or end_index - begin_index <= 1:
  		return
  
  	bit_position -= 1
  
  	snake_case__  					=      begin_index
  	snake_case__  					=      end_index - 1
  	while i <= j:
  		snake_case__  					=      False
  		if not (list_of_ints[i] >> bit_position) & 1:
  			# found zero at the beginning
  			i += 1
  			snake_case__  					=      True
  		if (list_of_ints[j] >> bit_position) & 1:
  			# found one at the end
  			j -= 1
  			snake_case__  					=      True
  
  		if changed:
  			continue
  
  		snake_case__					,     snake_case__  					=      list_of_ints[j], list_of_ints[i]
  		j -= 1
  		if j != i:
  			i += 1
  
  	_msd_radix_sort_inplace(UpperCAmelCase_				,							UpperCAmelCase_				,							UpperCAmelCase_				,							UpperCAmelCase_       )
  	_msd_radix_sort_inplace(UpperCAmelCase_				,							UpperCAmelCase_				,							UpperCAmelCase_				,							UpperCAmelCase_       )
  
  
  if __name__ == "__main__":
  			import doctest
  
  			doctest.testmod()
  
  
  
  
style_context: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  def 	__lowerCamelCase (  UpperCAmelCase_       )      ->int:
  	return 1 if input_a == 0 else 0
  
  
  
  
  def 	__lowerCamelCase (  )      ->None:
  	assert not_gate(0       ) == 1
  	assert not_gate(1       ) == 0
  
  
  if __name__ == "__main__":
  			print(not_gate(0))
  			print(not_gate(1))
  
  
  
  