def print_memory(function):
import memory_profiler<EOL>def wrapper(*args,**kwargs):<EOL><INDENT>m = StringIO()<EOL>temp_func = memory_profiler.profile(func = function,stream=m,precision=<NUM_LIT:4>)<EOL>output = temp_func(*args,**kwargs)<EOL>print(m.getvalue())<EOL>m.close()<EOL>return output<EOL><DEDENT>return wrapper<EOL>
Decorator that prints memory information at each call of the function