def auth_interface(method):
    def authed(auth, **args):
        """
        send request and decode response. Return the result in python format.
        """
        req = method(**args)
        parsed = urlparse(req.get_full_url())
        raw_str = '%s %s' % (req.get_method(), parsed.path)
        if parsed.query:
            raw_str += '?%s' % (parsed.query)
        raw_str += '\nHost: %s' % (parsed.netloc)
        if req.has_data():
            raw_str +=  '\nContent-Type: application/json'
        raw_str+="\n\n"
        if req.has_data():
            raw_str += req.get_data()
            req.add_header('Content-Type', 'application/json')
        req.add_header('Authorization', auth.auth_interface_str(raw_str))
        return send_and_decode(req)
    return authed
decorator takes func(**args) return req and change it to
dataset/ETHPy150Open pili-engineering/pili-sdk-python/pili/auth.py/auth_interface