<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_write_fields(self):
 """ Get the list of fields used to write the header, separating record and signal specification fields. Returns the default required fields, the user defined fields, and their dependencies. Does NOT include `d_signal` or `e_d_signal`. Returns ------- rec_write_fields : list Record specification fields to be written. Includes 'comment' if present. sig_write_fields : dict Dictionary of signal specification fields to be written, with values equal to the channels that need to be present for each field. """


        # Record specification fields
        rec_write_fields = self.get_write_subset('record')

        # Add comments if any
        if self.comments != None:
            rec_write_fields.append('comments')

        # Get required signal fields if signals are present.
        self.check_field('n_sig')

        if self.n_sig >  0:
            sig_write_fields = self.get_write_subset('signal')
        else:
            sig_write_fields = None

        return rec_write_fields, sig_write_fields