Return the number of points awarded to this submission.
169829
def points(self, include_hidden=False):
        """"""
        return sum(x.points for x in self.testable_results
                   if include_hidden or not x.testable.is_hidden)
861797
function () {
      var total = this.stats.length
      return this.stats.map(function (stat, i) {
        var point = valueToPoint(stat.value, i, total)
        return point.x + ',' + point.y
      }).join(' ')
    }
935385
def total_marks(self):
        """"""
        total = 0
        for answer in self.answers:
            for number, part in enumerate(answer):
                if number>0:
                    if part[2]>0:
                        total+=part[2]
        return total
1236634
public static int getNumPoints(Geometry geometry) {
		if (geometry == null) {
			throw new IllegalArgumentException("Cannot get total number of points for null geometry.");
		}
		int count = 0;
		if (geometry.getGeometries() != null) {
			for (Geometry child : geometry.getGeometries()) {
				count += getNumPoints(child);
			}
		}
		if (geometry.getCoordinates() != null) {
			count += geometry.getCoordinates().length;
		}
		return count;
	}
662668
def count(self, type, amount = 1):
        """"""
        if self.dovalidation: type = self._validate(type)
        if self._ranked: self._ranked = None
        if type in self._count:
            self._count[type] += amount
        else:
            self._count[type] = amount
        self.total += amount
1032874
def _availableResultsFraction( self ):
        """"""
        tr = self.notebook().numberOfResults() + self.notebook().numberOfPendingResults()
        if tr == 0:
            return 0
        else:
            return (self.notebook().numberOfResults() + 0.0) / tr
231696
def sel_entries(self):
        """"""
        ENTIRE_RECORD = 0xff
        rsp = self.send_message_with_name('GetSelInfo')
        if rsp.entries == 0:
            return
        reservation_id = self.get_sel_reservation_id()
        next_record_id = 0
        while True:
            req = create_request_by_name('GetSelEntry')
            req.reservation_id = reservation_id
            req.record_id = next_record_id
            req.offset = 0
            self.max_req_len = ENTIRE_RECORD

            record_data = ByteBuffer()
            while True:
                req.length = self.max_req_len
                if (self.max_req_len != 0xff
                        and (req.offset + req.length) > 16):
                    req.length = 16 - req.offset

                rsp = self.send_message(req)
                if rsp.completion_code == constants.CC_CANT_RET_NUM_REQ_BYTES:
                    if self.max_req_len == 0xff:
                        self.max_req_len = 16
                    else:
                        self.max_req_len -= 1
                    continue
                else:
                    check_completion_code(rsp.completion_code)

                record_data.extend(rsp.record_data)
                req.offset = len(record_data)

                if len(record_data) >= 16:
                    break

            next_record_id = rsp.next_record_id

            yield SelEntry(record_data)
            if next_record_id == 0xffff:
                break
1009120
public double getRewardTotal() {
        double rewards = 0.0;
        for (Map.Entry<Integer, Float> entry : this.map.entrySet()) {
            rewards += entry.getValue();
        }
        return rewards;
    }
394521
def num_rewards(self):
    

    # Pre-conditions: reward range is finite.
    #               : processed rewards are discrete.
    if not self.is_reward_range_finite:
      tf.logging.error("Infinite reward range, `num_rewards returning None`")
      return None
    if not self.is_processed_rewards_discrete:
      tf.logging.error(
          "Processed rewards are not discrete, `num_rewards` returning None")
      return None

    min_reward, max_reward = self.reward_range
    return max_reward - min_reward + 1
1124096
def vote_count(self):
        
        return Vote.objects.filter(
            content_type=ContentType.objects.get(app_label='poll', model='polloption'),
            object_id__in=[o.id for o in self.polloption_set.all()]
        ).aggregate(Sum('vote'))['vote__sum'] or 0
651740
def top_submitters(self, num):
        """"""
        num = min(num, len(self.submitters))
        if num <= 0:
            return ''

        top_submitters = sorted(
            iteritems(self.submitters),
            key=lambda x: (-sum(y.score for y in x[1]),
                           -len(x[1]), str(x[0])))[:num]

        retval = self.post_header.format('Top Submitters\' Top Submissions')
        for (author, submissions) in top_submitters:
            retval += '1. {}, {} submission{}: {}\n'.format(
                self._points(sum(x.score for x in submissions)),
                len(submissions),
                's' if len(submissions) != 1 else '', self._user(author))
            for sub in sorted(
                    submissions, key=lambda x: (-x.score, x.title))[:10]:
                title = self._safe_title(sub)
                if sub.permalink in sub.url:
                    retval += tt('  1. {}').format(title)
                else:
                    retval += tt('  1. [{}]({})').format(title, sub.url)
                retval += ' ({}, [{} comment{}]({}))\n'.format(
                    self._points(sub.score), sub.num_comments,
                    's' if sub.num_comments != 1 else '',
                    self._permalink(sub))
            retval += '\n'
        return retval
145735
def total_members_in_score_range(self, min_score, max_score):
        '''
        
        '''
        return self.total_members_in_score_range_in(
            self.leaderboard_name, min_score, max_score)
411654
def score(self, report):
        """"""
        score = 0

        try:
            # cuckoo-modified format
            score = report['malscore']
        except KeyError:
            # cuckoo-2.0 format
            score = report.get('info', {}).get('score', 0)

        return score
23758
def value(self):
    """"""
    return self._sum / tf.cast(self._count, self._dtype)
316548
def compute_rewards(self, scores):
        
        # get the k + 1 best scores in descending order
        best_scores = sorted(scores, reverse=True)[:self.k + 1]
        velocities = [best_scores[i] - best_scores[i + 1]
                      for i in range(len(best_scores) - 1)]

        # pad the list out with zeros to maintain the length of the list
        zeros = (len(scores) - self.k) * [0]
        return velocities + zeros
1236533
public int getNumPoints() {
		if (isEmpty()) {
			return 0;
		}
		int total = exteriorRing.getNumPoints();
		if (interiorRings != null) {
			for (LinearRing interiorRing : interiorRings) {
				total += interiorRing.getNumPoints();
			}
		}
		return total;
	}
458558
def score(self, phone_number, account_lifecycle_event, **params):
        
        return self.post(SCORE_RESOURCE.format(phone_number=phone_number),
                         account_lifecycle_event=account_lifecycle_event,
                         **params)