def set_value(redis, key, value):
    redis.set(key, pickle.dumps(value))

def get_value(redis, key):
    pickled_value = redis.get(key)
if pickled_value is None:
    return None
return pickle.loads(pickled_value)
get object from redis without eval?