python decorator to cache previous calls.