return quality score format -
        might return several if ambiguous.
961
def guessFormat(self):
        ''''''

        c = [ord(x) for x in self.quals]
        mi, ma = min(c), max(c)
        r = []
        for entry_format, v in iteritems(RANGES):
            m1, m2 = v
            if mi >= m1 and ma < m2:
                r.append(entry_format)
        return r
245690
def quality(self, key):
        
        for item, quality in self:
            if self._value_matches(key, item):
                return quality
        return 0
1313588
def score(self, testing_features, testing_labels):
        """"""
        # print("test features shape:",testing_features.shape)
        # print("testing labels shape:",testing_labels.shape)
        yhat = self.predict(testing_features)
        return self.scoring_function(testing_labels,yhat)
1090327
private void transformQualityScoresArray(int oldEncoding, int newEncoding) {
        // If the score types of the encodings are different
        if (FastQ.SCALE_SCORE[oldEncoding] != FastQ.SCALE_SCORE[newEncoding]) {
            // Score Map selection
            Map<Integer, Integer> scoreMap;
            if (FastQ.SCALE_SCORE[oldEncoding] == FastQ.PHRED_SCORE_TYPE) {
                scoreMap = FastQ.phredToSolexaMap;
            } else {
                scoreMap = FastQ.solexaToPhredMap;
            }
            // Transform each quality score in the quality scores array
            for (int i = 0; i < this.qualityScoresArray.length; i++) {
                if (qualityScoresArray[i] < 10) {
                    qualityScoresArray[i] = scoreMap.get(qualityScoresArray[i]);
                }
            }
        }
    }
210574
def get_stats_of_rows(rows):
    """"""
    count_true = count_false = max_score = 0
    for row in rows:
        if not row.properties:
            logging.info('Missing property for %s.', row.filename)
            continue
        if len(row.properties) > 1:
            # multiple properties not yet supported
            count_true = count_false = max_score = 0
            break
        expected_result = row.expected_results.get(row.properties[0].name)
        if not expected_result:
            continue
        if expected_result.result is True:
            count_true += 1
        elif expected_result.result is False:
            count_false += 1
        for prop in row.properties:
            max_score += prop.max_score(expected_result)

    return max_score, count_true, count_false
1019957
def _get_qualifier(val):
        """"""
        quals = set()
        if val == '':
            return quals
        for val in val.split('|'):
            val = val.lower()
            quals.add(val if val != 'not' else 'NOT')
        return quals
62675
protected int score(MediaType contentTypeFromRequest, MediaType... expectedTypes) {
        if (contentTypeFromRequest == null) {
            return DEFAULT_SCORE;
        }
        for (MediaType expected : expectedTypes) {
            if (contentTypeFromRequest.matches(expected)) {
                return MAXIMUM_FORMAT_SCORE;
            }
        }
        return DEFAULT_SCORE;
    }
410519
def format_and_score_diff_data(self, diff_results):
        """"""
        base = dict()
        meta = base.setdefault('meta', dict())
        tests = base.setdefault('tests', dict())
        score = base.setdefault('score', dict())
        for model_filename, result in iteritems(diff_results):
            if meta == dict():
                meta = result["meta"]
            for test_id, test_results in iteritems(result["tests"]):
                tests.setdefault(test_id, dict())
                if tests[test_id] == dict():
                    tests[test_id]["summary"] = test_results["summary"]
                    tests[test_id]["title"] = test_results["title"]
                    tests[test_id]["format_type"] = test_results["format_type"]
                if isinstance(test_results["metric"], dict):
                    tests[test_id].setdefault("diff", dict())
                    for param in test_results["metric"]:
                        tests[test_id]["diff"].setdefault(param, list()). \
                            append({
                                "model": model_filename,
                                "data": test_results["data"].setdefault(param),
                                "duration":
                                    test_results["duration"].setdefault(param),
                                "message":
                                    test_results["message"].setdefault(param),
                                "metric":
                                    test_results["metric"].setdefault(param),
                                "result":
                                    test_results["result"].setdefault(param)})
                else:
                    tests[test_id].setdefault("diff", list())
                    tests[test_id]["diff"].append({
                        "model": model_filename,
                        "data": test_results.setdefault("data"),
                        "duration": test_results.setdefault("duration"),
                        "message": test_results.setdefault("message"),
                        "metric": test_results.setdefault("metric"),
                        "result": test_results.setdefault("result")})
            self.result = result
            self.compute_score()
            score.setdefault('total_score', dict()).setdefault('diff', list())
            score.setdefault('sections', dict()).setdefault('diff', list())
            score['total_score']['diff'].append({
                "model": model_filename,
                "total_score": self.result['score']['total_score']})
            for section in self.result['score']['sections']:
                section.update({"model": model_filename})
                score['sections']['diff'].append(section)
        return base
785361
def quality_to_apply(self):
        
        if (self.request.quality is None):
            if (self.api_version <= '1.1'):
                return('native')
            else:
                return('default')
        return(self.request.quality)
1117979
def _quality_definition(self, qid):
        
        qualities = self._schema["qualities"]

        try:
            return qualities[qid]
        except KeyError:
            qid = self._schema["quality_names"].get(str(qid).lower(), 0)
            return qualities.get(qid, (qid, "normal", "Normal"))
1153559
def standardize(score):
    """"""
    score = asarray_ndim(score, 1)
    return (score - np.nanmean(score)) / np.nanstd(score)
736790
def parse_result(self, data):
        """"""
        def valid_score(score):
            return "" if score is None else score

        return self.Result(
            data["homeTeam"]["name"],
            valid_score(data["score"]["fullTime"]["homeTeam"]),
            data["awayTeam"]["name"],
            valid_score(data["score"]["fullTime"]["awayTeam"]))
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
909234
def probes_used_extract_scores(full_scores, same_probes):
  """"""
  if full_scores.shape[1] != same_probes.shape[0]: raise "Size mismatch"
  import numpy as np
  model_scores = np.ndarray((full_scores.shape[0],np.sum(same_probes)), 'float64')
  c=0
  for i in range(0,full_scores.shape[1]):
    if same_probes[i]:
      for j in range(0,full_scores.shape[0]):
        model_scores[j,c] = full_scores[j,i]
      c+=1
  return model_scores
972232
def _get_entry_scores(self):
        """"""
        if self.get_gradebook_column().get_grade_system().is_based_on_grades():
            return [e.get_grade().get_output_score() for e in self._entries if e.is_graded()]
        else:
            return [e.get_score() for e in self._entries if e.is_graded()]
300510
def _load_score(self):
        """"""
        score = int(self.score_file.read())
        self.score_file.seek(0, os.SEEK_SET)
        return score
1000885
private float getKnownFormatQuality(String pFormat) {
        for (int i = 0; i < sKnownFormats.length; i++) {
            if (pFormat.equals(sKnownFormats[i])) {
                return knownFormatQuality[i];
            }
        }
        return 0.1f;
    }