This does not work: module has to be passed explicitly to TheanoNose constructor to make it work inside a function.  In py3k branch this has been moved back to module level.