<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fix_checksums(self, buff):
 """ Fix a dex format buffer by setting all checksums :rtype: string """

        import zlib
        import hashlib

        signature = hashlib.sha1(buff[32:]).digest()

        buff = buff[:12] + signature + buff[32:]
        checksum = zlib.adler32(buff[12:])
        buff = buff[:8] + pack("=i", checksum) + buff[12:]

        debug("NEW SIGNATURE %s" % repr(signature))
        debug("NEW CHECKSUM %x" % checksum)

        return buff