py code generated by Nathan's thrift/storm patch