update python code from BitBucket