There's no need for this to live in the namespace of the function. Why not define it at the module level?