code: def tensorboard_to_pandas(file_path: str) -> pd.DataFrame:
      """Convert the tensorboard log to a pandas DataFrame.
  
      :param file_path: The path of the tensorboard log file.
      :return: A Pandas DataFrame with the columns "tag", "step", "value" (the fist two are set as index)
      """
      with open(file_path, "rb") as f:
          data = f.read()
  
      events = []
      while data:
          data, event_str = _read(data)
          event = event_pb2.Event()
  
          event.ParseFromString(event_str)
          if event.HasField("summary"):
              for value in event.summary.value:
                  if value.HasField("simple_value"):
                      events.append(
                          (event.step, value.tag, value.simple_value)
                      )
  
      return pd.DataFrame(
          events, columns=["step", "tag", "value"]
      ).set_index(["tag", "step"])
  
imports: import struct
  import pandas
  from tensorboard.compat.proto import event_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: tensorboard_to_pandas(file_path) and returns: pd