<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def property_pickled(f):
 """Same thing as above but the result will be stored on disk The path of the pickle file will be determined by looking for the `cache_dir` attribute of the instance containing the cached property. If no `cache_dir` attribute exists the `p` attribute will be accessed with the name of the property being cached."""

    # Called when you access the property #
    def retrieve_from_cache(self):
        # Is it in the cache ? #
        if '__cache__' not in self.__dict__: self.__cache__ = {}
        if f.__name__ in self.__cache__: return self.__cache__[f.__name__]
        # Where should we look in the file system ? #
        if 'cache_dir' in self.__dict__:
            path = FilePath(self.__dict__['cache_dir'] + f.func_name + '.pickle')
        else:
            path = getattr(self.p, f.func_name)
        # Is it on disk ? #
        if path.exists:
            with open(path) as handle: result = pickle.load(handle)
            self.__cache__[f.__name__] = result
            return result
        # Otherwise let's compute it #
        result = f(self)
        with open(path, 'w') as handle: pickle.dump(result, handle)
        self.__cache__[f.__name__] = result
        return result
    # Called when you set the property #
    def overwrite_cache(self, value):
        # Where should we look in the file system ? #
        if 'cache_dir' in self.__dict__:
            path = FilePath(self.__dict__['cache_dir'] + f.func_name + '.pickle')
        else:
            path = getattr(self.p, f.func_name)
        if value is None: path.remove()
        else: raise Exception("You can't set a pickled property, you can only delete it")
    # Return a wrapper #
    retrieve_from_cache.__doc__ = f.__doc__
    return property(retrieve_from_cache, overwrite_cache)