@classmethod
def set_cache_mode(cls, mode):
    """
        Set cache mode / behavoir.

        There are four available modes:

            CACHE_NONE - Cache is entirely disabled.

                         All method calls are directly forwarded and the
                         results (and cache keys, if needed) are not stored or
                         computed.

            CACHE_KEEP - Cache is enabled but never used to produce responses.

                         This mode will allow the caller to observe different
                         return values from a two calls to a single method if
                         the backing implementation would return those.

            CACHE_USE -  Cache is used if cached response exists.

                         This mode allows to use the cache to remove operations
                         assuming that all computation is purely functional and
                         depends on their arguments (which may not be true)
                         Missing cache values call into the backing
                         implementation

            CACHE_PURE - Cache is the only data source.

                         This mode never calls into the backing implementation.
                         As long as all responses are known it behaves as
                         CACHE_USE for any missing cache keys it raises
                         NotCachedError()

        By default cache is using the CACHE_NONE behavior to behave as if
        nothing was being intercepted and not to consume extra memory.
        It should be safe for all kinds of code.
        """
    cls.cache_mode = mode
