Calculate the Base 64 encoding of the HMAC for the given document.

def sha1_hmac(secret, document):
    """
        Calculate the Base 64 encoding of the HMAC for the given document.
    """
    signature = hmac.new(secret, document, hashlib.sha1).digest().encode("base64")[:-1]
    return signature