code: 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,
      )
  
file_path: tflearn/tflearn/summaries.py
imports: from __future__ import division, print_function, absolute_import
  import tensorflow.compat.v1
  from tensorflow.core.framework import summary_pb2
  from .utils import format_scope_name
label_desc: Use image node_id 8 for calling a global function with example usage: summary_exists(tag) and returns: next