def dumps_with_persistent_ids(obj, protocol=None):
 file = BytesIO()
 pickler = pickle.Pickler(file, protocol)
 pickler.persistent_id = _persistent_id
 pickler.dump(obj)
 return file.getvalue()

def dumps_with_persistent_ids ( obj , protocol = None ) : file = BytesIO ( ) pickler = pickle . Pickler ( file , protocol ) pickler . persistent_id = _persistent_id pickler . dump ( obj ) return file . getvalue ( )
performs a pickle dumps on the given object .