code: def test_TensorBoard_batch_metrics(self):
      model = self._get_model()
      x, y = np.ones((10, 10, 10, 1)), np.ones((10, 1))
      logdir, train_dir, validation_dir = self._get_log_dirs()
      tb_cbk = callbacks.TensorBoard(logdir, update_freq=1)
  
      model.fit(
          x,
          y,
          batch_size=2,
          epochs=2,
          validation_data=(x, y),
          callbacks=[tb_cbk],
      )
  
      summary_file = list_summaries(logdir)
      self.assertEqual(
          summary_file.scalars,
          {
              _ObservedSummary(logdir=train_dir, tag="batch_loss"),
              _ObservedSummary(logdir=train_dir, tag="epoch_loss"),
              _ObservedSummary(logdir=validation_dir, tag="epoch_loss"),
              _ObservedSummary(
                  logdir=train_dir, tag="epoch_learning_rate"
              ),
              _ObservedSummary(
                  logdir=validation_dir,
                  tag="evaluation_loss_vs_iterations",
              ),
          },
      )
  
imports: import collections
  import os
  import random
  import numpy
  import pytest
  import tensorflow.summary
  from tensorflow.compat.v1 import SummaryMetadata
  from tensorflow.core.util import event_pb2
  from tensorflow.python.lib.io import tf_record
  from keras import backend
  from keras import callbacks
  from keras import layers
  from keras import losses
  from keras import models
  from keras import ops
  from keras import optimizers
  from keras import testing
  from keras.optimizers import schedules
label_desc: Use image node_id 6 for calling the TestTensorBoardV2 obj's underlying member method code with example usage: obj.test_TensorBoard_batch_metrics() without return types