Please make this (or the equivalent in a joblib implementation) a module-level function, rather than a local closure.