<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(self, fp, options=None, text=None):
 """Renders the barcode and writes it to the file like object `fp`. :parameters: fp : File like object Object to write the raw data in. options : Dict The same as in `self.render`. text : str (unicode on Python 2) Text to render under the barcode. """

        output = self.render(options, text)
        if hasattr(output, 'tostring'):
            output.save(fp, format=self.writer.format)
        else:
            fp.write(output)