https://vk.com/dev/polls.getVoters
338679
def _get_voters(cls, session, owner_id, poll_id, answer_id):
        
        from .users import User

        return session.fetch_items("polls.getVoters", User._get_users, count=100, owner_id=owner_id, poll_id=poll_id, answer_ids=answer_id)
1229393
synchronized PollObj get_polled_obj_by_type_name(final int obj_type, final String obj_name)
	    throws DevFailed {
	// Get vector and search for type and name.
	final Vector po_list = get_poll_obj_list();
	for (int i = 0; i < po_list.size(); i++) {
	    final PollObj polled_obj = (PollObj) po_list.elementAt(i);
	    if (polled_obj.get_type_i() == obj_type) {
		if (polled_obj.get_name_i().equals(obj_name)) {
		    return polled_obj;
		}
	    }
	}

	// If not found throws exception
	Except.throw_exception("API_PollObjNotFound", obj_name
		+ " not found in list of polled object", "DeviceImpl.get_polled_obj_by_type_name");
	return null;
    }
1325008
def upvote(self):
        
        self.requester.post(
            '/{endpoint}/{id}/upvote',
            endpoint=self.endpoint, id=self.id
        )
        return self
1362798
def get_queryset(self):
        """"""

        queryset = super(MostVotedManager, self).get_queryset()

        sql = """
            SELECT
                count(sav.id)
            FROM
                colab_superarchives_vote AS sav
            WHERE
                colab_superarchives_message.id = sav.message_id
        """

        messages = queryset.extra(
            select={
                'vote_count': sql,
            }
        )
        return messages.order_by('-vote_count', 'received_time')
454356
def tally_poll(args):
    """"""
    if not args.msg:
        return "Syntax: !vote tally <pollnum>"
    if not args.msg.isdigit():
        return "Not A Valid Positive Integer."
    pid = int(args.msg)
    poll = get_open_poll(args.session, pid)
    if poll is None:
        return "That poll doesn't exist or was deleted. Use !poll list to see valid polls"
    state = "Active" if poll.active == 1 else "Closed"
    votes = args.session.query(Poll_responses).filter(Poll_responses.pid == pid).all()
    args.send("%s poll: %s, %d total votes" % (state, poll.question, len(votes)))
    votemap = collections.defaultdict(list)
    for v in votes:
        votemap[v.response].append(v.voter)
    for x in sorted(votemap.keys()):
        args.send("%s: %d -- %s" % (x, len(votemap[x]), ", ".join(votemap[x])), target=args.nick)
    if not votemap:
        return ""
    ranking = collections.defaultdict(list)
    for x in votemap.keys():
        num = len(votemap[x])
        ranking[num].append(x)
    high = max(ranking)
    winners = (ranking[high], high)
    if len(winners[0]) == 1:
        winners = (winners[0][0], high)
        return "The winner is %s with %d votes." % winners
    else:
        winners = (", ".join(winners[0]), high)
        return "Tie between %s with %d votes." % winners
1309050
function pollDo(fn, timeOut, doName, obj) {
  var siv = null;

  if (!obj) {
    obj = window;
  }
  if (timeOut == null) {
    timeOut = 100;
  }

  //If the previous poll operation is exist,then make it cancel.
  if (doName && obj[doName]) {
    clearInterval(obj[doName]);
  }

  //Polling execution operations every interval a period of time.
  siv = setInterval(function () {
    if (fn.call(obj) === false) {
      clearInterval(siv);
    }
  }, timeOut);

  if (doName) {
    obj[doName] = siv;
  }

  return siv;
}
651425
function pollStats(ms) {
    request('./stats', function (data) {
        o('li.inactive .count').text(data.inactiveCount);
        o('li.active .count').text(data.activeCount);
        o('li.complete .count').text(data.completeCount);
        o('li.failed .count').text(data.failedCount);
        o('li.delayed .count').text(data.delayedCount);
        setTimeout(function () {
            pollStats(ms);
        }, ms);
    });
}
1293228
function UI($pollsecs=5)
	{
	global $ADODB_LOG_CONN;

    $perf_table = adodb_perf::table();
	$conn = $this->conn;

	$app = $conn->host;
	if ($conn->host && $conn->database) $app .= ', db=';
	$app .= $conn->database;

	if ($app) $app .= ', ';
	$savelog = $this->conn->LogSQL(false);
	$info = $conn->ServerInfo();
	if (isset($_GET['clearsql'])) {
		$this->clearsql();
	}
	$this->conn->LogSQL($savelog);

	// magic quotes

	if (isset($_GET['sql']) && get_magic_quotes_gpc()) {
		$_GET['sql'] = $_GET['sql'] = str_replace(array("\\'",'\"'),array("'",'"'),$_GET['sql']);
	}

	if (!isset($_SESSION['ADODB_PERF_SQL'])) $nsql = $_SESSION['ADODB_PERF_SQL'] = 10;
	else  $nsql = $_SESSION['ADODB_PERF_SQL'];

	$app .= $info['description'];


	if (isset($_GET['do'])) $do = $_GET['do'];
	else if (isset($_POST['do'])) $do = $_POST['do'];
	 else if (isset($_GET['sql'])) $do = 'viewsql';
	 else $do = 'stats';

	if (isset($_GET['nsql'])) {
		if ($_GET['nsql'] > 0) $nsql = $_SESSION['ADODB_PERF_SQL'] = (integer) $_GET['nsql'];
	}
	echo "<title>ADOdb Performance Monitor on $app</title><body bgcolor=white>";
	if ($do == 'viewsql') $form = "<td><form># SQL:<input type=hidden value=viewsql name=do> <input type=text size=4 name=nsql value=$nsql><input type=submit value=Go></td></form>";
	else $form = "<td>&nbsp;</td>";

	$allowsql = !defined('ADODB_PERF_NO_RUN_SQL');
	global $ADODB_PERF_MIN;
	$app .= " (Min sql timing \$ADODB_PERF_MIN=$ADODB_PERF_MIN secs)";

	if  (empty($_GET['hidem']))
	echo "<table border=1 width=100% bgcolor=lightyellow><tr><td colspan=2>
	<b><a href=http://adodb.sourceforge.net/?perf=1>ADOdb</a> Performance Monitor</b> <font size=1>for $app</font></tr><tr><td>
	<a href=?do=stats><b>Performance Stats</b></a> &nbsp; <a href=?do=viewsql><b>View SQL</b></a>
	 &nbsp; <a href=?do=tables><b>View Tables</b></a> &nbsp; <a href=?do=poll><b>Poll Stats</b></a>",
	 $allowsql ? ' &nbsp; <a href=?do=dosql><b>Run SQL</b></a>' : '',
	 "$form",
	 "</tr></table>";


	 	switch ($do) {
		default:
		case 'stats':
			if (empty($ADODB_LOG_CONN))
				echo "<p>&nbsp; <a href=\"?do=viewsql&clearsql=1\">Clear SQL Log</a><br>";
			echo $this->HealthCheck();
			//$this->conn->debug=1;
			echo $this->CheckMemory();
			break;
		case 'poll':
			$self = htmlspecialchars($_SERVER['PHP_SELF']);
			echo "<iframe width=720 height=80%
				src=\"{$self}?do=poll2&hidem=1\"></iframe>";
			break;
		case 'poll2':
			echo "<pre>";
			$this->Poll($pollsecs);
			break;

		case 'dosql':
			if (!$allowsql) break;

			$this->DoSQLForm();
			break;
		case 'viewsql':
			if (empty($_GET['hidem']))
				echo "&nbsp; <a href=\"?do=viewsql&clearsql=1\">Clear SQL Log</a><br>";
			echo($this->SuspiciousSQL($nsql));
			echo($this->ExpensiveSQL($nsql));
			echo($this->InvalidSQL($nsql));
			break;
		case 'tables':
			echo $this->Tables(); break;
		}
		global $ADODB_vers;
		echo "<p><div align=center><font size=1>$ADODB_vers Sponsored by <a href=http://phplens.com/>phpLens</a></font></div>";
	}
479017
def get_rating(self):
        """"""
        if not (self.votes and self.score):
            return 0
        return float(self.score)/(self.votes+self.field.weight)
359929
def show(request, pollId):
    """"""

    # Get the poll
    curDB.execute('SELECT id, title, description FROM Poll WHERE id = ? ORDER BY title', (pollId,))
    poll = curDB.fetchone()

    if poll is None:
        return {}

    responses = []
    totalVotes = 0
    votedFor = 0

    # Compute the list of responses
    curDB.execute('SELECT id, title FROM Response WHERE pollId = ? ORDER BY title ', (poll[0],))
    resps = curDB.fetchall()

    for rowRep in resps:

        votes = []
        nbVotes = 0

        # List each votes
        for rowVote in curDB.execute('SELECT username FROM Vote WHERE responseId = ?', (rowRep[0],)):

            nbVotes += 1

            # If the user is and administrator, saves each votes
            if request.args.get('ebuio_u_ebuio_admin') == 'True':
                votes.append(rowVote[0])

            # Save the vote of the current suer
            if request.args.get('ebuio_u_username') == rowVote[0]:
                votedFor = rowRep[0]

        totalVotes += nbVotes
        responses.append({'id': rowRep[0], 'title': rowRep[1], 'nbVotes': nbVotes, 'votes': votes})

    return {'id': poll[0], 'name': poll[1], 'description': poll[2], 'responses': responses, 'totalVotes': totalVotes, 'votedFor': votedFor}
916612
def query_get_user_reports_and_votes(uid):
    
    query1 = """SELECT nb_votes_yes,
                       nb_votes_total,
                       nb_abuse_reports
                FROM "cmtRECORDCOMMENT"
                WHERE id_user=%s"""
    params1 = (uid,)
    res1 = run_sql(query1, params1)
    if len(res1) == 0:
        return ()
    nb_votes_yes = nb_votes_total = nb_abuse_reports = 0
    for cmt_tuple in res1:
        nb_votes_yes += int(cmt_tuple[0])
        nb_votes_total += int(cmt_tuple[1])
        nb_abuse_reports += int(cmt_tuple[2])
    return (nb_abuse_reports, nb_votes_yes, nb_votes_total)
4946
@Override
	public double[] getVotesForInstance(Instance inst)
	{
		double[] votes = new double[2];

		if (this.reset == false)
		{
			double error = this.getAnomalyScore(inst);
			
			// Exponential function to convert the error [0, +inf) into a vote [1,0].
			votes[0] = Math.pow(2.0, -1.0 * (error / this.threshold));
			votes[1] = 1.0 - votes[0];
		}

		return votes;
	}
809367
@Override
	public double[] getVotesForInstance(Instance inst)
	{
		double[] votes = {0.5, 0.5};
		
		if(!referenceWindow)
		{
			votes[1] = this.getAnomalyScore(inst) + 0.5 - this.anomalyThreshold;
			votes[0] = 1.0 - votes[1];
		}
		
		return votes;
	}
723778
def votes(self, req) -> int:
        
        try:
            votes = len(self[req.key].propagates)
        except KeyError:
            votes = 0
        return votes
1293002
def get_rating_for_user(self, user, ip_address=None, cookies={}):
        """"""
        kwargs = dict(
            content_type    = self.get_content_type(),
            object_id       = self.instance.pk,
            key             = self.field.key,
        )

        if not (user and user.is_authenticated()):
            if not ip_address:
                raise ValueError('``user`` or ``ip_address`` must be present.')
            kwargs['user__isnull'] = True
            kwargs['ip_address'] = ip_address
        else:
            kwargs['user'] = user
        
        use_cookies = (self.field.allow_anonymous and self.field.use_cookies)
        if use_cookies:
            # TODO: move 'vote-%d.%d.%s' to settings or something
            cookie_name = 'vote-%d.%d.%s' % (kwargs['content_type'].pk, kwargs['object_id'], kwargs['key'][:6],) # -> md5_hexdigest?
            cookie = cookies.get(cookie_name)
            if cookie:    
                kwargs['cookie'] = cookie
            else:
                kwargs['cookie__isnull'] = True
            
        try:
            rating = Vote.objects.get(**kwargs)
            return rating.score
        except Vote.MultipleObjectsReturned:
            pass
        except Vote.DoesNotExist:
            pass
        return
255811
def list_poll_choices_in_poll(self, poll_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - poll_id
        """ID"""
        path["poll_id"] = poll_id

        self.logger.debug("GET /api/v1/polls/{poll_id}/poll_choices with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/polls/{poll_id}/poll_choices".format(**path), data=data, params=params, no_data=True)
751109
public function getPoll($poll_id)
    {
        $this->checkId($poll_id);

        return $this->adapter->get(sprintf('/polls/%d', $poll_id));
    }