code: def MergeAllSummaries(period=0, run_alone=False, key=None):
      """
      Evaluate all summaries by ``tf.summary.merge_all``, and write them to logs.
  
      This callback is one of the :func:`DEFAULT_CALLBACKS()`.
  
      Args:
          period (int): by default the callback summarizes once every epoch.
              This option (if not set to 0) makes it additionally summarize every ``period`` steps.
          run_alone (bool): whether to evaluate the summaries alone.
              If True, summaries will be evaluated after each epoch alone.
              If False, summaries will be evaluated together with the
              `sess.run` calls, in the last step of each epoch.
              For :class:`SimpleTrainer`, it needs to be False because summary may
              depend on inputs.
          key (str): the collection of summary tensors. Same as in ``tf.summary.merge_all``.
              Default is ``tf.GraphKeys.SUMMARIES``.
      """
      if key is None:
          key = tf.GraphKeys.SUMMARIES
      period = int(period)
      if run_alone:
          return MergeAllSummaries_RunAlone(period, key)
      else:
          return MergeAllSummaries_RunWithOp(period, key)
  
imports: import numpy
  from collections import deque
  from ..compat import tfv1
  from ..tfutils.common import get_op_tensor_name
  from ..utils import logger
  from ..utils.naming import MOVING_SUMMARY_OPS_KEY
  from .base import Callback
label_desc: Use image node_id 1 for calling a global function with example usage: MergeAllSummaries(period, run_alone, key) and returns: MergeAllSummaries_RunAlone, MergeAllSummaries_RunWithOp