<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sign(self, request, authheaders, secret):
 """Returns the signature appropriate for the request. The request is not changed by this function. Keyword arguments: request -- A request object which can be consumed by this API. authheaders -- A string-indexable object which contains the headers appropriate for this signature version. secret -- The base64-encoded secret key for the HMAC authorization. """

        mac = hmac.HMAC(secret.encode('utf-8'), digestmod=self.digest)
        mac.update(self.signable(request, authheaders).encode('utf-8'))
        digest = mac.digest()
        return base64.b64encode(digest).decode('utf-8')