(username)
return UserExists(exists, exists)
:param username:
    :return: namedtuple(exists:bool, is_deleted:bool)
:param username:
    :return: namedtuple(exists:bool, is_deleted:bool)
: param username : : return : namedtuple ( exists : bool is_deleted : bool )
def user_exists(username):
    """
    :param username:
    :return: namedtuple(exists:bool, is_deleted:bool)
    """
    result = CommCareUser.get_db().view(
        'users/by_username',
        key=username,
        include_docs=False,
        reduce=False,
    )
    if result:
        return UserExists(True, False)

    result = CommCareUser.get_db().view(
        'deleted_users_by_username/view',
        key=username,
        include_docs=False,
        reduce=False
    ).count()
    exists = bool(result)
    return UserExists(exists, exists)
def user_exists ( username ) : result = CommCareUser . get_db ( ) . view ( 'users/by_username' , key = username , include_docs = False , reduce = False , ) if result : return UserExists ( True , False ) result = CommCareUser . get_db ( ) . view ( 'deleted_users_by_username/view' , key = username , include_docs = False , reduce = False ) . count ( ) exists = bool ( result ) return UserExists ( exists , exists )