code: def register_embedding(weights, labels, log_dir) -> None:
      """Saves a metadata file (labels) and a checkpoint (derived from weights)
      and configures the Embedding Projector to read from the appropriate locations.
  
      Args:
        weights: tf.Variable with the weights of the embedding layer to be displayed.
        labels: list of labels corresponding to the weights.
        logdir: Directory into which to store the config file, as a `str`.
      """
  
      # Create a checkpoint from embedding, the filename and key are
      # name of the tensor.
      checkpoint = tf.train.Checkpoint(embedding=weights)
      checkpoint.save(os.path.join(LOG_DIR, "embedding.ckpt"))
  
      # Save Labels separately on a line-by-line manner.
      with open(os.path.join(log_dir, METADATA_FNAME), "w") as f:
          for label in labels:
              f.write("{}\n".format(label))
  
      # Set up config
      config = projector.ProjectorConfig()
      embedding = config.embeddings.add()
      # The name of the tensor will be suffixed by `/.ATTRIBUTES/VARIABLE_VALUE`
      embedding.tensor_name = "embedding/.ATTRIBUTES/VARIABLE_VALUE"
      embedding.metadata_path = METADATA_FNAME
      projector.visualize_embeddings(log_dir, config)
  
imports: import os
  import tensorflow
  from tensorboard.plugins import projector
  import tensorflow_datasets
label_desc: Use image node_id 1 for calling a global function with example usage: register_embedding(weights, labels, log_dir) without return types