def machine():
    """Return type of machine."""
if os.name == 'nt' and sys.version_info[:2] < (2, 7):
    return os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get(
        'PROCESSOR_ARCHITECTURE', ''))
else:
    return platform.machine()

def os_bits(machine=machine()):
    """Return bitness of operating system, or None if unknown."""
machine2bits = {'AMD64': 64, 'x86_64': 64, 'i386': 32, 'x86': 32}
return machine2bits.get(machine, None)
In Python, how do you determine whether the kernel is running in 32-bit or 64-bit mode?