Unable to use from_py_func

Tried and failed. Posted for help. Thanks!