This isn't working because the previous cell doesn't actually define a function (``... do something ...`` isn't actually code).  Perhaps the upper two code cells should be removed and only the one below that actually works should be left in? (And of course the text needs merging.)