There's no reason this function cannot work without joblib; let's not introduce that dependency.