the code is here: https://github.com/apache/incubator-livy/blob/master/python-api/src/main/python/livy/client.py