new python example for streaming mode