'set the cache value for the given key
:param key:
the key to store the value under
:param obj:
the value to store; note that obj *must* be picklable'

def set(self, key, obj):

    if (key is None):
        raise ValueError('key    cannot    be    None')
    try:
        pickle.dumps(obj, protocol=(-1))
    except pickle.PicklingError:
        raise ValueError('obj    must    be    picklable')
    if isinstance(obj, list):
        obj = tuple(obj)
    elif isinstance(obj, dict):
        obj = frozendict(obj)
    elif isinstance(obj, set):
        obj = frozenset(obj)
    with self._write_lock:
        self._objects[key] = obj
        self._dirty = True
    self._schedule_save()
