def save(filename, obj): """ Save an object using JSON-pickle. """ with open_filename(filename, "w") as fh: return fh.write(encode(obj))
def load(filename): """ Load a JSON-pickled object. """ with open_filename(filename, "r") as fh: return decode(fh.read())