def _makeTracePlayable(self, trace, traceFileName, checkCoherence = True):
    """Makes sure that the given trace is playable.
       @returns a tuple (trace_file_name, is_temporary), where the is_temporary 
                flag indicates that the trace file is temporary and should be 
                deleted after playing.
    """
    # Find a suitable exporter
    try:
      exporter = [e for e in self.analyzer.exportPlugins if e.formatName == "binary"][0]
    except __HOLE__:
      self.analyzer.fail("No binary format exporter found.")
      
    # Check that the trace file is playable -- if not, we need to resave it
    if traceFileName and checkCoherence:
      reader = BinaryCodec.Reader(trace, open(traceFileName, "rb"))
      if not reader.isTracePlayable():
        self.analyzer.reportWarning("The trace file will be normalized before playing. Save and reload the trace to avoid this step.")
        traceFileName = None
      
    # If there is no physical trace file, save the trace to a temporary file
    if not traceFileName:
      fd, traceFileName = tempfile.mkstemp(suffix = "_trace.bin")
      os.close(fd)
      traceFile = open(traceFileName, "wb")
      exporter.saveTrace(trace, traceFile)
      traceFile.close()
      removeTraceFile = True
    else:
      removeTraceFile = False
    return (traceFileName, removeTraceFile)
dataset/ETHPy150Open skyostil/tracy/src/analyzer/plugins/player/Player.py/TracePlayer._makeTracePlayable