code: def GenerateTestData(path):
      """Generates the test data directory."""
      run1_path = os.path.join(path, "run1")
      os.makedirs(run1_path)
      writer1 = tf.summary.FileWriter(run1_path)
      WriteScalarSeries(writer1, "foo/square", lambda x: x * x)
      WriteScalarSeries(writer1, "bar/square", lambda x: x * x)
      WriteScalarSeries(writer1, "foo/sin", math.sin)
      WriteScalarSeries(writer1, "foo/cos", math.cos)
      WriteHistogramSeries(
          writer1,
          "histo1",
          [[0, 1], [0.3, 1], [0.5, 1], [0.7, 1], [1, 1]],
      )
      WriteImageSeries(writer1, "im1")
      WriteImageSeries(writer1, "im2")
      WriteAudioSeries(writer1, "au1")
  
      run2_path = os.path.join(path, "run2")
      os.makedirs(run2_path)
      writer2 = tf.summary.FileWriter(run2_path)
      WriteScalarSeries(writer2, "foo/square", lambda x: x * x * 2)
      WriteScalarSeries(writer2, "bar/square", lambda x: x * x * 3)
      WriteScalarSeries(writer2, "foo/cos", lambda x: math.cos(x) * 2)
      WriteHistogramSeries(
          writer2,
          "histo1",
          [[0, 2], [0.3, 2], [0.5, 2], [0.7, 2], [1, 2]],
      )
      WriteHistogramSeries(
          writer2,
          "histo2",
          [[0, 1], [0.3, 1], [0.5, 1], [0.7, 1], [1, 1]],
      )
      WriteImageSeries(writer2, "im1")
      WriteAudioSeries(writer2, "au2")
  
      graph_def = tf.compat.v1.GraphDef()
      node1 = graph_def.node.add()
      node1.name = "a"
      node1.op = "matmul"
      node2 = graph_def.node.add()
      node2.name = "b"
      node2.op = "matmul"
      node2.input.extend(["a:0"])
  
      writer1.add_graph(graph_def)
      node3 = graph_def.node.add()
      node3.name = "c"
      node3.op = "matmul"
      node3.input.extend(["a:0", "b:0"])
      writer2.add_graph(graph_def)
      writer1.close()
      writer2.close()
  
file_path: tensorboard/tensorboard/scripts/generate_testdata.py
imports: import bisect
  import math
  import os
  import os.path
  import random
  import shutil
  from absl import app
  from absl import flags
  import numpy
  import tensorflow
label_desc: Use image node_id 7 for calling a global function with example usage: GenerateTestData(path) without return types