Notifies the owner of the current request (so, the user doing the
        exercise) that they've solved the exercise, and mark it as
        solved in the database.
553152
def solveAndNotify(self, request):
        
        remote = request.transport.remote
        withThisIdentifier = Exercise.identifier == self.exerciseIdentifier
        exercise = self.store.findUnique(Exercise, withThisIdentifier)
        solveAndNotify(remote, exercise)
1106193
protected synchronized void postTaskExecution() {
		if (stopped) {
			// Stopped, so don't count the task(s) as done.
			// (worker threads call this method even if the task was not really executed.)
			return;
		}
		tasksDoneCount++;
		int percentageComplete = tasksDoneCount * 100 / tasksTotalCount;

		// Compute the progress and notify the listeners
		this.notifyListenersSpiderProgress(percentageComplete, tasksDoneCount, tasksTotalCount - tasksDoneCount);

		// Check for ending conditions
		if (tasksDoneCount == tasksTotalCount && initialized) {
			this.complete();
		}
	}
1134094
def update(cls, **kwargs):
        '''
        
        '''
        q = cls._get_instance(**{'id': kwargs['id']})
        if q:
            for k, v in kwargs.items():
                setattr(q, k, v)
            _action_and_commit(q, session.add)
        else:
            cls.get_or_create(**kwargs)
1318106
def mark_done(task_id):
  
  task = Task.get_by_id(task_id)
  if task is None:
    raise ValueError('Task with id %d does not exist' % task_id)
  task.done = True
  task.put()
400020
def finished(self):
        
        self.data_service.update_activity(self.id, self.name, self.desc,
                                          started_on=self.started,
                                          ended_on=self._current_timestamp_str())
346638
public void markAsUnspent() {
        if (parent != null)
            if (log.isDebugEnabled()) log.debug("Un-marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), spentBy);
        else
            if (log.isDebugEnabled()) log.debug("Un-marked floating output as spent by {}", spentBy);
        availableForSpending = true;
        spentBy = null;
    }
287113
function() {
    // If the user is on a valid value, then we increment the value, but if
    // they've typed something that's not right we page through predictions
    if (this.assignment.getStatus() === Status.VALID) {
      return this.requisition.nudge(this.assignment, 1).then(function() {
        this.textChanged();
        this.focusManager.onInputChange();
        return true;
      }.bind(this));
    }

    return Promise.resolve(false);
  }
1373463
def finish(self):
        
        if self._has_responded:
            raise NSQException('already responded')
        self._has_responded = True
        self.on_finish.send(self)
82620
private void notifyTTAboutTaskCompletion() {
    if (oobHeartbeatOnTaskCompletion) {
      synchronized (finishedCount) {
        int value = finishedCount.get();
        finishedCount.set(value+1);
        finishedCount.notifyAll();
      }
    }
  }
1217140
def on_new_request(self, task):
        ''''''
        task['status'] = self.taskdb.ACTIVE
        self.insert_task(task)
        self.put_task(task)

        project = task['project']
        self._cnt['5m'].event((project, 'pending'), +1)
        self._cnt['1h'].event((project, 'pending'), +1)
        self._cnt['1d'].event((project, 'pending'), +1)
        self._cnt['all'].event((project, 'pending'), +1)
        logger.info('new task %(project)s:%(taskid)s %(url)s', task)
        return task
242559
function giveAnswer(answeringPlayer, answer) {
    if(answeringPlayer === seller) return;
    if(answer <= currentBid) return;

    buyer = answeringPlayer;
    currentBid = answer;

    resetTimer();
    notify(false);
  }
452666
def finish_user(self, subid):
    ''''''        

    p = self.revoke_token(subid)
    p.token = "finished"
    self.session.commit()
    return p
496880
public function mark_for_regrade() {
        global $DB;
        if ($this->has_active_instances()) {
            $conditions = array('definitionid'  => $this->definition->id,
                        'status'  => gradingform_instance::INSTANCE_STATUS_ACTIVE);
            $DB->set_field('grading_instances', 'status', gradingform_instance::INSTANCE_STATUS_NEEDUPDATE, $conditions);
        }
    }
645333
def _AskUser(self):
    
    if self._show_percent:
      progress = int(self._displayed*100 / (len(self._text.splitlines())))
      progress_text = ' (%d%%)' % progress
    else:
      progress_text = ''
    question = AnsiText(
        'Enter: next line, Space: next page, '
        'b: prev page, q: quit.%s' %
        progress_text, ['green'])
    sys.stdout.write(question)
    sys.stdout.flush()
    ch = self._GetCh()
    sys.stdout.write('\r%s\r' % (' '*len(question)))
    sys.stdout.flush()
    return ch
176211
def solvedBy(self, user):
        
        _Solution(store=self.store, who=user, what=self)
932299
function (data) {
          var isSigned = isTokenSigned(data.file);
          var isFinished = data.status === 'finished';
          var isComplete = isSigned && isFinished;
          debug('checking if run', url, 'is finished', isComplete);
          if (isComplete) {
            testRuns.removeListener('patched', checkIfRunIsFinished);
            resolve(data);
          }
        }
729770
def post(self, receiver_id=None):
        """"""
        try:
            user_id = request.oauth.access_token.user_id
        except AttributeError:
            user_id = current_user.get_id()

        event = Event.create(
            receiver_id=receiver_id,
            user_id=user_id
        )
        db.session.add(event)
        db.session.commit()

        # db.session.begin(subtransactions=True)
        event.process()
        db.session.commit()
        return make_response(event)