code: def setUp(self):
      super().setUp()
      self.logdir = self.get_temp_dir()
      self.ctx = context.RequestContext()
  
      logdir = os.path.join(self.logdir, "polynomials")
      with tf.summary.create_file_writer(logdir).as_default():
          for i in range(10):
              scalar_summary.scalar(
                  "square", i**2, step=2 * i, description="boxen"
              )
              scalar_summary.scalar("cube", i**3, step=3 * i)
  
      logdir = os.path.join(self.logdir, "waves")
      with tf.summary.create_file_writer(logdir).as_default():
          for i in range(10):
              scalar_summary.scalar("sine", tf.sin(float(i)), step=i)
              scalar_summary.scalar(
                  "square", tf.sign(tf.sin(float(i))), step=i
              )
              # Summary with rank-0 data but not owned by the scalars plugin.
              metadata = summary_pb2.SummaryMetadata()
              metadata.plugin_data.plugin_name = "marigraphs"
              metadata.data_class = summary_pb2.DATA_CLASS_SCALAR
              tf.summary.write(
                  "high_tide", tensor=i, step=i, metadata=metadata
              )
              # Summary with rank-1 data of scalar data class (bad!).
              metadata = summary_pb2.SummaryMetadata()
              metadata.plugin_data.plugin_name = "greetings"
              metadata.data_class = summary_pb2.DATA_CLASS_SCALAR
              tf.summary.write(
                  "bad", tensor=[i, i], step=i, metadata=metadata
              )
  
      logdir = os.path.join(self.logdir, "lebesgue")
      with tf.summary.create_file_writer(logdir).as_default():
          data = [
              ("very smooth", (0.0, 0.25, 0.5, 0.75, 1.0), "uniform"),
              ("very smoothn't", (0.0, 0.01, 0.99, 1.0), "bimodal"),
          ]
          for description, distribution, name in data:
              tensor = tf.constant([distribution], dtype=tf.float64)
              for i in range(1, 11):
                  histogram_summary.histogram(
                      name, tensor * i, step=i, description=description
                  )
  
      logdir = os.path.join(self.logdir, "mondrian")
      with tf.summary.create_file_writer(logdir).as_default():
          data = [
              ("red", (221, 28, 38), "top-right"),
              ("blue", (1, 91, 158), "bottom-left"),
              ("yellow", (239, 220, 111), "bottom-right"),
          ]
          for name, color, description in data:
              image_1x1 = tf.constant([[[color]]], dtype=tf.uint8)
              for i in range(1, 11):
                  # Use a non-monotonic sequence of sample sizes to
                  # test `max_length` calculation.
                  k = 6 - abs(6 - i)  # 1, .., 6, .., 2
                  # a `k`-sample image summary of `i`-by-`i` images
                  image = tf.tile(image_1x1, [k, i, i, 1])
                  image_summary.image(
                      name,
                      image,
                      step=i,
                      description=description,
                      max_outputs=99,
                  )
  
imports: import os
  import numpy
  from tensorboard import context
  from tensorboard.backend.event_processing import data_provider
  from tensorboard.backend.event_processing import plugin_event_multiplexer
  from tensorboard.compat.proto import summary_pb2
  from tensorboard.data import provider
  from tensorboard.plugins.graph import metadata
  from tensorboard.plugins.histogram import metadata
  from tensorboard.plugins.histogram import summary_v2
  from tensorboard.plugins.scalar import metadata
  from tensorboard.plugins.scalar import summary_v2
  from tensorboard.plugins.image import metadata
  from tensorboard.plugins.image import summary_v2
  from tensorboard.util import tensor_util
  import tensorflow.compat.v1
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling the MultiplexerDataProviderTest obj's underlying member method code with example usage: obj.setUp() without return types