<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(cls, output_file, samples, labels, delimiter=None):
 """ Writes a text file with samples. Parameters output_file : str The path of the file to write. samples : FieldArray Samples to write to file. labels : list A list of strings to include as header in TXT file. delimiter : str Delimiter to use in TXT file. """

        delimiter = delimiter if delimiter is not None else cls.delimiter
        header = delimiter.join(labels)
        numpy.savetxt(output_file, samples,
                      comments=cls.comments, header=header,
                      delimiter=delimiter)