code: def replace(self, key, value):
          
          check_not_none(key, "key can't be none")
          check_not_none(value, "value can't be none")
          return self._encode_invoke(transactional_map_replace_codec, key=self._to_data(key),
                                     value=self._to_data(value))
docs: Transactional implementation of :func:`Map.replace(key, value) <hazelcast.proxy.map.Map.replace>`
  
          The object to be replaced will be accessible only in the current transaction context till the transaction is
          committed.
  
          :param key: (object), the specified key.
          :param value: (object), the value to replace the previous value.
          :return: (object), previous value associated with key, or ``None`` if there was no mapping for key.