Stream calculation in python.