limit and offset from python code