def _writeheader(self, record):
        """ Write the header to the stream.

        The header is created and sent to the stream followed by the separator
        line. The stream buffers are flushed if necessary.

        Parameters
        ----------
        data : class
            The class of the data entry record.

        """
        if self._formatted and hasattr(record, 'header'):
            header = record.header.format(*record._fields)
        else:
            header = u' '.join(str(value) for value in record._fields)
        header += u'\n'

        separator = u'-' * (1 - len(header)) + u'\n'
        self._stream.write(header)
        self._stream.write(separator)
        if self._auto_flush:
            self._stream.flush()
dataset/ETHPy150Open enthought/pikos/pikos/recorders/text_stream_recorder.py/TextStreamRecorder._writeheader/swapped operands of `-`