>Hang on. On lines L255 and L256 you want the raw function definition, which means you must not encode it as a string, is that correct?

Yes, it's correct.