def generate_signature(data, secret):
    return hmac.new(six.b(secret),
                    msg=six.b(to_query(data)),
                    digestmod=hashlib.sha256).hexdigest()
signature takes a dict / tuple /string
dataset/ETHPy150Open gocardless/gocardless-python/gocardless/utils.py/generate_signature