code: def keras():
      """Create a Keras conceptual graph and op graphs.
  
      The `keras/train` run has a run-level graph, a `batch_2` tag with op
      graph only (`graph_run_metadata_graph` plugin), and a `keras` tag
      with a Keras conceptual graph only (`graph_keras_model` plugin).
      """
      logdir = os.path.join(LOGDIR, "keras")
  
      data_size = 1000
      train_fac = 0.8
      train_size = int(data_size * train_fac)
      x = np.linspace(-1, 1, data_size)
      np.random.shuffle(x)
      y = 0.5 * x + 2 + np.random.normal(0, 0.05, (data_size,))
      (x_train, y_train) = x[:train_size], y[:train_size]
      (x_test, y_test) = x[train_size:], y[train_size:]
  
      layers = [
          tf.keras.layers.Dense(16, input_dim=1),
          tf.keras.layers.Dense(1),
      ]
      model = tf.keras.models.Sequential(layers)
      model.compile(
          loss=tf.keras.losses.mean_squared_error,
          optimizer=tf.keras.optimizers.SGD(lr=0.2),
      )
      model.fit(
          x_train,
          y_train,
          batch_size=train_size,
          verbose=0,
          epochs=100,
          validation_data=(x_test, y_test),
          callbacks=[tf.keras.callbacks.TensorBoard(logdir)],
      )
  
file_path: tensorboard/tensorboard/plugins/graph/graphs_demo.py
imports: import contextlib
  import os
  import tensorflow
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: keras() without return types