Update votes

@param Vote $vote
779260
public function updateVote($vote)
    {

        $out = [
            "yes" => $vote->getYes(),
            "no" => $vote->getNo(),
        ];

        $this->updateValue($this->allPlayers, "VoteUpdater", Builder::getArray($out, true));
    }
1251067
private function updateIssue($issue, $result)
    {
        if ($result === StepEvent::FAILED && $this->reopenOnFail) {
            $this->jiraService->reopenIssue($issue);
        }
    }
20112
synchronized boolean update() {
        int elected = this.elected;
        int oldelected = this.oldelected;
        int lbfactor = this.lbfactor;
        if (lbfactor > 0) {
            this.lbstatus = ((elected - oldelected) * 1000) / lbfactor;
        }
        this.oldelected = elected;
        return elected != oldelected; // ping if they are equal
    }
379214
public function update( $count ) {
		update_post_meta(
			$this->post_id,
			'_inc2734_count_cache_' . $this->service_name,
			[
				'count'      => $count,
				'expiration' => time() + (int) apply_filters( 'inc2734_wp_share_buttons_count_cache_seconds', 60 * 5 ),
			]
		);
	}
751185
public function update(array $preferences, $user = null)
    {
        foreach ($preferences as $key => $value) {
            $this->getPreferenceOrFail($key);
        }

        $this->backend->setPreferences($preferences, $this->getUserId($user));
    }
1214654
def update_forum_votes(sender, **kwargs):
    
    vote = kwargs['instance']
    if vote.content_type.app_label != "fretboard":
        return
    if vote.content_type.model == "topic":
        t = get_model('fretboard', 'Topic').objects.get(id=vote.object.id)
        t.votes = t.score()
        t.save(update_fields=['votes'])
    elif vote.content_type.model == "post":
        p = get_model('fretboard', 'Post').objects.get(id=vote.object.id)
        p.votes = p.score()
        p.save(update_fields=['votes'])
309371
public function poll($redis)
    {
        if (!$redis) {
            return;
        }
        list(, $chan, $msg) = $redis->result;
        $this->pollMode = json_decode($msg, true);

        Timer::setTimeout($this->finishTimer);
        $this->flush();
    }
922946
def addVote(self, commit: Commit, voter: str) -> None:
        
        super()._add_msg(commit, voter)
822534
public function vote(DataObject $post, $dir = 1) {
		$member = $this->securityContext->getMember();
		
		if ($this->requireVoteBalance && $member->VotesToGive <= 0) {
			$post->RemainingVotes = 0;
			return $post;
		}

		// we allow multiple votes - as many as the user has to give! unless
		// configured not to...
		$currentVote = null; 
		
		if ($this->singleVotes) {
			$votes = $post->currentVotesByUser();
			if (count($votes)) {
				$currentVote = $votes[0];
			}
		}
		
		if (!$currentVote) {
			$currentVote = MicroPostVote::create();
			$currentVote->UserID = $member->ID;
			$currentVote->PostID = $post->ID;
		}
		
		$currentVote->Direction = $dir > 0 ? 1 : -1;
		$currentVote->write();
		
		$list = DataList::create('MicroPostVote');
		
		$upList = $list->filter(array('PostID' => $post->ID, 'Direction' => 1));
		$post->Up = $upList->count();
		
		$downList = $list->filter(array('PostID' => $post->ID, 'Direction' => -1));
		$post->Down = $downList->count();
		
		$owner = $post->Owner();
		if (!$post->OwnerID || !$owner || !$owner->exists()) {
			$owner = Security::findAnAdministrator();
		}

		// write the post as the owner, and calculate some changes for the author
		$this->transactionManager->run(function () use ($post, $currentVote, $member) {
			$author = $post->Owner();
			if ($author && $author->exists() && $author->ID != $member->ID) {
				if ($currentVote->Direction > 0) {
					$author->Up += 1;
				} else {
					$author->Down += 1;
				}
				$author->write();
			}
			$post->write();
		}, $owner);

		$this->rewardMember($member, -1);
		$post->RemainingVotes = $member->VotesToGive;

		return $post;
	}
376828
public function updateStatus($status)
    {
        if(empty($this->payload['id'])) {
            return;
        }

        $statusInstance = new Status($this->payload['id']);
        $statusInstance->update($status);
    }
1188479
public function removeVoter(User $voter)
    {
        if ($this->voters->contains($voters) === true) {
            $this->voters->removeElement($voter);
        }

        return $this;
    }
1100113
public function decideClass(array $votes)
    {
        $scores = array_fill_keys($this->classes, 0.);

        foreach ($votes as $i => $vote) {
            $scores[$vote] += $this->influences[$i];
        }

        return argmax($scores);
    }
1051834
public function unvote($voter)
    {
        $voteup = $this->voteups->getQuery(true)
                                ->disableChain()
                                ->voter($voter)
                                ->fetch();
        if ($voteup) {
            $voteup->delete();
        }
        $votedown = $this->votedowns->getQuery(true)
                                    ->disableChain()
                                    ->voter($voter)
                                    ->fetch();
        if ($votedown) {
            $votedown->delete();
        }
    }
422017
final public function update(array $data)
    {
        $this->query->setStartUpdate($data);

        $this->query->prepare()->bindSetForUpdate($data)->bindWhere()->bindLimit()->execute();

        $this->setRowCount();

        $this->query->close();
    }
192383
public function vote($item, $type = 'up_vote')
    {
        $items = array_fill_keys((array) $this->checkVoteItem($item), ['type' => $type]);

        return $this->votedItems()->sync($items, false);
    }
1001630
public function update($props)
    {
    
        if (isset($props['permissions'])) {
            $this->updatePermissions($props['permissions']);
            unset($props['permissions']);
        }
        
        if (isset($props['fields'])) {
            $this->updateFields($props['fields']);
            unset($props['fields']);
        }        
    
        $this->fields = $props;        
        $this->save();       
    }
991193
public function onVoterVote(VoteEvent $event)
    {
        $this->traceableAccessDecisionManager->addVoterVote($event->getVoter(), $event->getAttributes(), $event->getVote());
    }