Tiny enhance for py function