code: def get_and_alter(self, function):
          
  
          check_not_none(function, "function can't be None")
          return self._encode_invoke(atomic_reference_get_and_alter_codec, function=self._to_data(function))
docs: Alters the currently stored reference by applying a function on it on and gets the old value.
  
          :param function: (Function), A stateful serializable object which represents the Function defined on
              server side.
              This object must have a serializable Function counter part registered on server side with the actual
              ``org.hazelcast.core.IFunction`` implementation.
          :return: (object), the old value, the value before the function is applied.