@gen.coroutine
  def _TryUpdate(self, client):
    """Creates a new notification database record using the next available notification_id.
    Avoids race conditions by using the "expected" argument to Update in order to ensure that
    a unique notification_id is used. If another notification allocates a particular
    notification_id first, this method will return False. The caller can then retry with a new
    notification_id.
    """
    try:
      yield gen.Task(self.Update, client, expected={'notification_id': False})
    except Exception as e:
      # Notification creation failed, so return False so caller can retry.
      logging.info((self.notification_id, e) % 'notification id %d is already in use: %s')
      raise gen.Return(False)

    raise gen.Return(True)
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/notification.py/Notification._TryUpdate/swapped operands of `%`