def _write_header(self, data_label=None, time_stamp=None):
byteorder = self._byteorder<EOL>self._file.write(bytes('<STR_LIT>', '<STR_LIT:utf-8>'))<EOL>bio = BytesIO()<EOL>bio.write(self._tag(bytes('<STR_LIT>', '<STR_LIT:utf-8>'), '<STR_LIT>'))<EOL>bio.write(self._tag(byteorder == "<STR_LIT:>>" and "<STR_LIT>" or "<STR_LIT>", '<STR_LIT>'))<EOL>assert self.nvar < <NUM_LIT:2> ** <NUM_LIT:16><EOL>bio.write(self._tag(struct.pack(byteorder + "<STR_LIT:H>", self.nvar), '<STR_LIT>'))<EOL>bio.write(self._tag(struct.pack(byteorder + "<STR_LIT:I>", self.nobs), '<STR_LIT:N>'))<EOL>label = data_label[:<NUM_LIT>] if data_label is not None else '<STR_LIT>'<EOL>label_len = struct.pack(byteorder + "<STR_LIT:B>", len(label))<EOL>label = label_len + bytes(label, '<STR_LIT:utf-8>')<EOL>bio.write(self._tag(label, '<STR_LIT:label>'))<EOL>if time_stamp is None:<EOL><INDENT>time_stamp = datetime.datetime.now()<EOL><DEDENT>elif not isinstance(time_stamp, datetime.datetime):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>months = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>month_lookup = {i + <NUM_LIT:1>: month for i, month in enumerate(months)}<EOL>ts = (time_stamp.strftime("<STR_LIT>") +<EOL>month_lookup[time_stamp.month] +<EOL>time_stamp.strftime("<STR_LIT>"))<EOL>ts = b'<STR_LIT>' + bytes(ts, '<STR_LIT:utf8>')<EOL>bio.write(self._tag(ts, '<STR_LIT>'))<EOL>bio.seek(<NUM_LIT:0>)<EOL>self._file.write(self._tag(bio.read(), '<STR_LIT>'))<EOL>
Write the file header