code: def write_metadata_tsv(loc, data):
      """Write Tensorboard `"metadata.tsv"` file.
  
      Parameters
      ----------
      loc: str
          Directory where the file is written.
      data: list of strings or pd.DataFrame
          Label(s) for each embedding point in the Tensorboard visualization.
          If ``data`` is a list of strings then no header will be written. If it is a `pandas DataFrame` with multiple
          columns, then the headers will be written.
      """
  
      # Write metadata.tsv
      metadata_path = os.path.join(loc, "metadata.tsv")
  
      if isinstance(data, list):
          with open(
              metadata_path, "w+", encoding="utf8"
          ) as metadata_file:
              for row in data:
                  metadata_file.write("%s\n" % row)
  
      elif isinstance(data, pd.DataFrame):
          data.to_csv(metadata_path, sep="\t", index=False)
  
      else:
          raise ValueError(
              "Labels must be passed as a list or a dataframe"
          )
  
file_path: AmpliGraph/ampligraph/utils/model_utils.py
imports: import glob
  import logging
  import os
  import pickle
  import shutil
  from time import gmtime, strftime
  import numpy
  import pandas
  import tensorflow
  from tensorboard.plugins import projector
label_desc: Use image node_id 4 for calling a global function with example usage: write_metadata_tsv(loc, data) without return types