or code that is to be run as a doctest in Python Sphinx, a useful trick to use in iPython
>>> import numpy as np
>>> some_value = 35
You can copy this directly into iPython and it will treat it like normal python code.
No need having to copy every line of code after