docstr: Returns the default FileWriter instance. Recreates it if closed.
docstr_tok: ["Returns","the","default","FileWriter","instance",".","Recreates","it","if","closed","."]
code: def _get_file_writer(self):
      """Returns the default FileWriter instance. Recreates it if closed."""
      if self.rank > 0:
          return TTDummyFileWriter()
  
      if self.all_writers is None or self.file_writer is None:
          if self.purge_step is not None:
              most_recent_step = self.purge_step
              self.file_writer = FileWriter(
                  self.log_dir,
                  self.max_queue,
                  self.flush_secs,
                  self.filename_suffix,
              )
              self.file_writer.debug = self.debug
              self.file_writer.rank = self.rank
  
              self.file_writer.add_event(
                  Event(
                      step=most_recent_step,
                      file_version="brain.Event:2",
                  )
              )
              self.file_writer.add_event(
                  Event(
                      step=most_recent_step,
                      session_log=SessionLog(status=SessionLog.START),
                  )
              )
          else:
              self.file_writer = FileWriter(
                  self.log_dir,
                  self.max_queue,
                  self.flush_secs,
                  self.filename_suffix,
              )
          self.all_writers = {
              self.file_writer.get_logdir(): self.file_writer
          }
      return self.file_writer
  
imports: import contextlib
  import json
  import os
  import shutil
  from datetime import datetime
  import numpy
  import pandas
  from imageio import imwrite
  from tensorboard.compat.proto.event_pb2 import Event
  from tensorboard.compat.proto.event_pb2 import SessionLog
  from torch.utils.tensorboard import SummaryWriter, FileWriter
label_desc: Use image node_id 22 for calling the Experiment obj's underlying member method code with example usage: obj._get_file_writer() and returns: self, TTDummyFileWriter