You have to run your script with ipython:
$ ipython python/my_test_imagenet.py
Then get_ipython will be already in global context.
Note: Importing it via from IPython import get_ipython in ordinary shell python will not work as you really need ipython running.