def memoize(func):
cache = {}<EOL>@wraps(func)<EOL>def inner(filename):<EOL><INDENT>if filename not in cache:<EOL><INDENT>cache[filename] = func(filename)<EOL><DEDENT>return cache[filename]<EOL><DEDENT>return inner<EOL>
Cache result of function call.