code: def _trace_filename(self):
          
          dir_stub = ''
          if self.output_directory is not None:
              dir_stub = self.output_directory
          if self.each_time:
              filename = '{0}_{1}.json'.format(
                  self.output_file_name, self.counter)
          else:
              filename = '{0}.json'.format(self.output_file_name)
          return os.path.join(dir_stub, filename)
docs: Creates trace filename.