def METHOD_NAME(wrapped):
    if not wrapped.closed:
        raise RuntimeError("alru_cache is not closed")
    # pylint: disable=protected-access
    was_closed = (
        wrapped.hits == wrapped.misses == len(wrapped.tasks) == len(wrapped._cache) == 0
    )
    if not was_closed:
        raise RuntimeError("alru_cache was not closed correctly")
    wrapped.closed = False