<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_record(self, warc_record):
 """Adds a warc record to this WARC file. """

        warc_record.write_to(self.fileobj)
        # Each warc record is written as separate member in the gzip file
        # so that each record can be read independetly.
        if isinstance(self.fileobj, gzip2.GzipFile):
            self.fileobj.close_member()