def summary_exists(tag):
    """ summary_exists.

    Check if a summary exists.

    Arguments:
        tag: `str`. The summary name.

    Returns:
        A `bool`. Whether the summary exists or not.

    """
    return next(
        (item['tensor'] for item in tf.get_collection("summary_tags") if
         item["tag"] == tag), None)
dataset/ETHPy150Open tflearn/tflearn/tflearn/summaries.py/summary_exists/original