Canonical interview question

Write the cache decorator in python.