def get_user():
import getpass<EOL>try:<EOL><INDENT>return getpass.getuser()<EOL><DEDENT>except (ImportError, KeyError):<EOL><INDENT>return None<EOL><DEDENT>
Return the current user name, or None if getuser() does not work
    in the current environment (see #1010).