Oh, right. I had to add it when I tried this in ipython first and then forgot to put it into the docstring as well.
It turned out I forgot to run the doctests, there are some more missing imports and typos.