code: def _open_file(filename):
          
          if filename is None:
              raise DataSourceError("Trace filename is not defined")
  
          try:
              trace_file = open(filename, "r")
          except IOError as e:
              raise DataSourceError("Unable to open trace file %s" % filename, e)
          else:
              LOG.debug("Opened trace file %s", filename)
              return trace_file
docs: Attempt to open the the file at ``filename`` for reading.
  
          Raises:
              DataSourceError, if the file cannot be opened.