This may be better done as a block of code in *markdown* rather than as actually ipython notebook "code" - that is, change it to markdown and just surround it with \`\`\` .   Right now it seems like that's code that's actually meant to be *run* rather than a pseudo-code example (and indeed, the notebook runs it but gives a syntax error)