code: def stream_tfevents(path, file_api, step=0):
      
      last_step = 0
      row = {}
      buffer = []
      last_row = {}
      for summary in tf.train.summary_iterator(path):
          parsed = tf_summary_to_dict(summary)
          if last_step != parsed["tensorflow_step"]:
              step += 1
              last_step = parsed["tensorflow_step"]
              # TODO: handle time
              if len(row) > 0:
                  last_row = to_json(row)
                  buffer.append(Chunk("wandb-history.jsonl",
                                      util.json_dumps_safer_history(to_json(row))))
          row.update(parsed)
      file_api._send(buffer)
      return last_row
docs: Parses and streams a tfevents file to the server