<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_blacklist (self):
 """ Write the blacklist. """

        oldmask = os.umask(0077)
        for key, value in self.blacklist.items():
            self.write(u"%d %s%s" % (value, repr(key), os.linesep))
        self.close_fileoutput()
        # restore umask
        os.umask(oldmask)