def get_def_username(request, auth):
    # Try to determine the current system user's username to use as a default.
    try:
        def_username = getpass.getuser().replace(' ', '').lower()
    except (__HOLE__, KeyError):
        # KeyError will be raised by os.getpwuid() (called by getuser())
        # if there is no corresponding entry in the /etc/passwd file
        # (a very restricted chroot environment, for example).
        def_username = ''
    # Determine whether the default username is taken, so we don't display
    # it as an option.
    if def_username:
        user = auth.get_user(request, username=def_username)
        if user:
            def_username = ''
    return def_username
dataset/ETHPy150Open quantmind/lux/lux/extensions/odm/commands/create_superuser.py/get_def_username