docstr: Inits a file that we log historical experiments
  :return:
docstr_tok: ["Inits","a","file","that","we","log","historical","experiments",":","return",":"]
code: def __init_cache_file_if_needed(self):
      """
      Inits a file that we log historical experiments
      :return:
      """
      try:
          exp_cache_file = self.get_data_path(self.name, self.version)
          if not os.path.isdir(exp_cache_file):
              os.makedirs(exp_cache_file, exist_ok=True)
      except Exception as e:
          # file already exists (likely written by another exp. In this case disable the experiment
          self.debug = True
  
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 7 for calling the Experiment obj's underlying member method code with example usage: obj.__init_cache_file_if_needed() without return types