'Pickles a provided value.'

def _do_pickle(self, value):

    pickle_data = cStringIO.StringIO()
    pickler = self._pickler_factory(pickle_data, protocol=self._pickle_protocol)
    if (self._persistent_id is not None):
        pickler.persistent_id = self._persistent_id
    pickler.dump(value)
    return pickle_data.getvalue()
