def _cacheAction(self, action,
                     obj_name, key,
                     ignore_module,
                     ignore_local,
                     ignore_dependencies,
                     is_disk_writable,
                     is_persistent,
                     creation_function = None,
                     obj = None):

        if key is not None:
            key = TreeDict(key = key).hash()

        d_key = (obj_name, key, ignore_module, ignore_local,
                 ignore_dependencies, is_persistent)

        try:
            container = self.__container_map[d_key]
        except __HOLE__:
            container = self.__container_map[d_key] = self._pnode.getCacheContainer(
                obj_name, key, ignore_module, ignore_local,
                ignore_dependencies, is_disk_writable, is_persistent)

        if not is_disk_writable:
            container.disableDiskWriting()

        if action == "query":
            return container.objectIsLoaded()
        elif action == "load":
            if not container.objectIsLoaded():
                if creation_function is None:
                    raise RuntimeError(
                        "creation_function must be supplied if the "
                        "object is not available in the cache.")
                
                container.setObject(creation_function())
                
            return container.getObject()
        
        elif action == "save":
            container.setObject(obj)

        elif action == "key":
            return container.getKeyAsString()
        
        else:
            assert False
dataset/ETHPy150Open hoytak/lazyrunner/lazyrunner/pmodule/pmodulebase.py/PModule._cacheAction