

def get_env(name, current=True):
    "Return HKCU/HKLM environment variable name and value\n\n    For example, get_user_env('PATH') may returns:\n    ('Path', u'C:\\Program Files\\Intel\\WiFi\\bin\\')"
    root = (winreg.HKEY_CURRENT_USER if current else winreg.HKEY_LOCAL_MACHINE)
    key = winreg.OpenKey(root, 'Environment')
    for index in range(0, winreg.QueryInfoKey(key)[1]):
        try:
            value = winreg.EnumValue(key, index)
            if (value[0].lower() == name.lower()):
                return (value[0], value[1])
        except:
            break

dataset/ETHPy150Open winpython/winpython/winpython/utils.py get_env/original