def getuser():

    import os

    for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'):
        user = os.environ.get(name)
        if user:
            return user

    # If this fails, the exception will "explain" why
    import pwd
    return pwd.getpwuid(os.getuid())[0]

# Bind the name getpass to the appropriate function
Get the username from the environment or password database.
dataset/ETHPy150Open ctxis/canape/CANAPE.Scripting/Lib/getpass.py/getuser