problem.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:picoCTF 作者: royragsdale 项目源码 文件源码
def get_all_problems(category=None, show_disabled=False):
    """
    Gets all of the problems in the database.

    Args:
        category: Optional parameter to restrict which problems are returned
        show_disabled: Boolean indicating whether or not to show disabled problems.
    Returns:
        List of problems from the database
    """

    db = api.common.get_conn()

    match = {}
    if category is not None:
        match.update({'category': category})

    if not show_disabled:
        match.update({'disabled': False})

    return list(db.problems.find(match, {"_id":0}).sort('score', pymongo.ASCENDING))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号