import pwd


def valid_user(username):
    """
    Returns True if the username given is a valid username on the system
    """
    try:
        if username and pwd.getpwnam(username):
            return True
    except KeyError:
        # getpwnam returns a key error if entry isn't present
        return False

    return False