def sign(self, request, consumer, token):
        """Builds the base signature string."""
        key, raw = self.signing_base(request, consumer, token)

        hashed = hmac.new(key, raw, sha1)

        # Calculate the digest base 64.
        return binascii.b2a_base64(hashed.digest())[:-1]
def sign ( self , request , consumer , token ) : key , raw = self . signing_base ( request , consumer , token ) hashed = hmac . new ( key , raw , sha1 ) return binascii . b2a_base64 ( hashed . digest ( ) ) [ : - 1 ]
Builds the base signature string.