<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datagramReceived(self, datagram, address):
 """ After receiving a datagram, generate the deferreds and add myself to it. """

        def write(result):
            print "Writing %r" % result
            self.transport.write(result, address)

        d = self.d()
        #d.addCallbacks(write, log.err)
        d.addCallback(write)  # errors are silently ignored!
        d.callback(datagram)