def save_cache ( data , filename ) : with open ( filename , 'wb' ) as handle : pickle . dump ( data , handle )
python save file to temporary directory then stream it to memcached
Save cookies to a file .
def save_cache(data, filename):
    """Save cookies to a file."""
    with open(filename, 'wb') as handle:
        pickle.dump(data, handle)