@app.route('/pypi/check_update/<dist_name>')
def check_pypi_update(dist_name):
    """ Just check for updates and return a json
    with the attribute "has_update".

    :param dist_name: distribution name
    :rtype: json
    :return: json with the attribute "has_update"
    """
    pkg_res = get_pkg_res()
    pkg_dist_version = pkg_res.get_distribution(dist_name).version
    pypi_rel = get_pypi_releases(dist_name)

    if pypi_rel:
        pypi_last_version = pkg_res.parse_version(pypi_rel[0])
        current_version = pkg_res.parse_version(pkg_dist_version)

        if pypi_last_version > current_version:
            DIST_PYPI_CACHE.add(dist_name.lower())
            return jsonify({"has_update": 1})

    try:
        DIST_PYPI_CACHE.remove(dist_name.lower())
    except __HOLE__:
        pass

    return jsonify({"has_update": 0})
dataset/ETHPy150Open perone/stallion/stallion/main.py/check_pypi_update