'Set the value'

def set(self, val):

    import time
    now = time.time()
    expected_value = []
    new_val = {}
    new_val['timestamp'] = now
    if (self._value is not None):
        new_val['last_value'] = self._value
        expected_value = ['current_value', str(self._value)]
    new_val['current_value'] = val
    try:
        self.db.put_attributes(self.id, new_val, expected_value=expected_value)
        self.timestamp = new_val['timestamp']
    except SDBResponseError as e:
        if (e.status == 409):
            raise ValueError('Sequence    out    of    sync')
        else:
            raise
