scheme_adapters/polyfit_adapter/cache.py [28:43]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class Cache:
    def __init__(self, path, cache_name, option):
        self.path = path + "/caches/.cache_" + cache_name
        if option == "force":
            cache = dict()
            with open(self.path, 'wb') as pkl_file:
                pickle.dump(cache, pkl_file, protocol=pickle.HIGHEST_PROTOCOL)
        elif option == "check":
            if os.path.isfile(self.path):
                return
            else:
                cache = dict()
                with open(self.path, 'wb') as pkl_file:
                    pickle.dump(cache, pkl_file, protocol=pickle.HIGHEST_PROTOCOL)
        else:
            raise Exception("Invalid option")
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



scheme_adapters/pso_adapter/cache.py [7:22]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class Cache:
    def __init__(self, path, cache_name, option):
        self.path = path + "/caches/.cache_" + cache_name
        if option == "force":
            cache = dict()
            with open(self.path, 'wb') as pkl_file:
                pickle.dump(cache, pkl_file, protocol=pickle.HIGHEST_PROTOCOL)
        elif option == "check":
            if os.path.isfile(self.path):
                return
            else:
                cache = dict()
                with open(self.path, 'wb') as pkl_file:
                    pickle.dump(cache, pkl_file, protocol=pickle.HIGHEST_PROTOCOL)
        else:
            raise Exception("Invalid option")
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



