<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def memoized(maxsize=1024):
 """ Momoization decorator for immutable classes and pure functions. """

    cache = SimpleCache(maxsize=maxsize)

    def decorator(obj):
        @wraps(obj)
        def new_callable(*a, **kw):
            def create_new():
                return obj(*a, **kw)

            key = (a, tuple(kw.items()))
            return cache.get(key, create_new)
        return new_callable
    return decorator