def METHOD_NAME(self, params):
    signature = [(k.lower(), v) for k, v in list(params.items())]
    signature.sort(key=lambda x: x[0])
    pairs = []
    for pair in signature:
        key = urlquote(str(pair[0]), safe="[]")
        value = urlquote(str(pair[1]), safe="[]*")
        item = "{}={}".format(key, value)
        pairs.append(item)
    signature = "&".join(pairs)
    signature = signature.lower().replace("+", "%20")
    signature = hmac.new(b(self.key), msg=b(signature), digestmod=hashlib.sha1)
    return base64.b64encode(b(signature.digest()))