Fully parses game summary report.
    :returns: boolean success indicator
    :rtype: bool
960215
def parse(self):
    
    
    r = super(GameSummRep, self).parse()
    try:
      self.parse_scoring_summary()
      return r and False
    except:
      return False
1180668
def _scheduled_check_for_summaries(self):
        """"""
        if self._analysis_process is None:
            return
        # handle time out
        timed_out = time.time() - self._analyze_start_time > self.time_limit
        if timed_out:
            self._handle_results('Analysis timed out but managed\n'
                                 ' to get lower turn results.',
                                 'Analysis timed out with no results.')
            return
        # handle standard completion
        try:
            self._analysis_process.join(0.001)
        except AssertionError:
            pass  # if some timing issue with closed process, just continue
        if not self._analysis_process.is_alive():
            self._handle_results('Completed analysis.',
                                 'Unable to find the game on screen.')
            return
        #finally, if it's still alive, then come back later
        self._base.after(self._POLL_PERIOD_MILLISECONDS,
                         self._scheduled_check_for_summaries)
727760
def _check_success(self):
        
        t, d, cos = self._compute_orientation()

        return d < 0.06 and t >= -0.12 and t <= 0.14 and cos > 0.95
1224512
def collect_results(self) -> Optional[Tuple[int, Dict[str, float]]]:
        
        self.wait_to_finish()
        if self.decoder_metric_queue.empty():
            if self._results_pending:
                self._any_process_died = True
            self._results_pending = False
            return None
        decoded_checkpoint, decoder_metrics = self.decoder_metric_queue.get()
        assert self.decoder_metric_queue.empty()
        self._results_pending = False
        logger.info("Decoder-%d finished: %s", decoded_checkpoint, decoder_metrics)
        return decoded_checkpoint, decoder_metrics
752653
def check_if_win(self):
        """"""
        self.flagcount = 0
        win = True
        for x in range(0, len(self.mine_matrix[0])):
            for y in range(0, len(self.mine_matrix)):
                if self.mine_matrix[y][x].state == 1:
                    self.flagcount += 1
                    if not self.mine_matrix[y][x].has_mine:
                        win = False
                elif self.mine_matrix[y][x].has_mine:
                    win = False
        self.lblMineCount.set_text("%s" % self.minecount)
        self.lblFlagCount.set_text("%s" % self.flagcount)
        if win:
            self.dialog = gui.GenericDialog(title='You Win!', message='Game done in %s seconds' % self.time_count)
            self.dialog.confirm_dialog.do(self.new_game)
            self.dialog.cancel_dialog.do(self.new_game)
            self.dialog.show(self)
1330268
def collect_and_report(self):
        
        logger.debug("Metric reporting thread is now alive")

        def metric_work():
            self.process()
            if self.agent.is_timed_out():
                logger.warn("Host agent offline for >1 min.  Going to sit in a corner...")
                self.agent.reset()
                return False
            return True

        every(1, metric_work, "Metrics Collection")
83153
def reportMatchCompletion(cfg, results, replayData):
    """"""
    payload = json.dumps([cfg.flatten(), results, replayData])
    ladder = cfg.ladder
    return requests.post(
        url  = c.URL_BASE%(ladder.ipAddress, ladder.serverPort, "matchfinished"),
        data = payload,
        #headers=headers,
    )
984177
def _get_stat(self):
        

        def dev_filter(x):
            # get first word and remove trailing interface number
            x = x.strip().split(" ")[0][:-1]

            if x in self.interfaces_blacklist:
                return False

            if self.all_interfaces:
                return True

            if x in self.interfaces:
                return True

            return False

        # read devfile, skip two header files
        x = filter(dev_filter, open(self.devfile).readlines()[2:])

        try:
            # split info into words, filter empty ones
            return [list(filter(lambda x: x, _x.split(" "))) for _x in x]

        except StopIteration:
            return None
252647
def success_count(self):
        
        return len([i for i, result in enumerate(self.data) if result.success])
369205
def parse_game_event(self, event):
        

        if event.eventid in self.event_lookup:
            #Bash this into a nicer data format to work with
            event_type = self.event_lookup[event.eventid]
            ge = GameEvent(event_type.name)

            for i, key in enumerate(event.keys):
                key_type = event_type.keys[i]
                ge.keys[key_type.name] = getattr(key,
                                                    KEY_DATA_TYPES[key.type])

            self.debug("|==========> %s" % (ge, ))

            self.run_hooks(ge)
152343
def parse_file_info(self, file_info):
        

        self.info["playback_time"] = file_info.playback_time
        self.info["match_id"] = file_info.game_info.dota.match_id
        self.info["game_mode"] = file_info.game_info.dota.game_mode
        self.info["game_winner"] = file_info.game_info.dota.game_winner

        for index, player in enumerate(file_info.game_info.dota.player_info):
            p = self.heroes[player.hero_name]
            p.name = player.player_name
            p.index = index
            p.team = 0 if index < 5 else 1

            self.indexed_players[index] = p
            self.info["players"][player.player_name] = p
184912
def results(self):
        

        results = {
            'overall': self.results_overall_metrics(),
            'class_wise': self.results_class_wise_metrics(),
            'class_wise_average': self.results_class_wise_average_metrics()
        }

        return results
282162
def summary(self):
        
        if self.get('Summary'):
            return self.get('Summary')

        body, more, is_markdown = self._entry_content
        return TrueCallableProxy(
            self._get_summary,
            body or more) if is_markdown else CallableProxy(None)
160637
def _won_in(self):
        """"""
        if not self._summary['finished']:
            return
        starting_age = self._summary['settings']['starting_age'].lower()
        if starting_age == 'post imperial':
            starting_age = 'imperial'
        ages_reached = set([starting_age])
        for player in self._summary['players']:
            for age, reached in player['ages'].items():
                if reached:
                    ages_reached.add(age)
        ages = ['imperial', 'castle', 'feudal', 'dark']
        for age in ages:
            if age in ages_reached:
                return age
272323
def _parse_achievements(self, rows):
        
        for row in rows:
            cols = row.find_all('td')
            if len(cols) != 2:
                continue
            field, value = cols
            grade = str(field).count("achievement-grade-symbol")
            name = value.text.strip()
            self.achievements.append(Achievement(name, grade))
676686
def parse(data)
      game = GameItem.new(get_title(data), get_genres(data),
        get_download_size(data), get_release_date(data), get_description(data),
        get_price(data), get_avg_rating(data), get_avg_ratings_count(data),
        get_platforms(data), get_languages(data), get_developer(data),
        get_publisher(data), get_modes(data), get_bonus_content(data),
        get_reviews(data), get_pegi_age(data))      

      game
    end
1351736
def result_report_class_wise(self):
        

        results = self.results_class_wise_metrics()

        output = self.ui.section_header('Class-wise metrics', indent=2) + '\n'
        output += self.ui.row(
            'Tag', 'Nref', 'Nsys', 'F-score', 'Pre', 'Rec', 'EER',
            widths=[20, 12, 12, 12, 12, 12, 12],
            separators=[True, False, True, False, False, True, False],
            indent=4
        ) + '\n'
        output += self.ui.row('-', '-', '-', '-', '-', '-', '-') + '\n'

        for tag_label in self.tag_label_list:
            if results[tag_label]['f_measure']['f_measure'] is not None:
                f_measure = results[tag_label]['f_measure']['f_measure'] * 100

            else:
                f_measure = None

            if results[tag_label]['f_measure']['precision'] is not None:
                precision = results[tag_label]['f_measure']['precision'] * 100

            else:
                precision = None

            if results[tag_label]['f_measure']['recall'] is not None:
                recall = results[tag_label]['f_measure']['recall'] * 100

            else:
                recall = None

            if results[tag_label]['eer']['eer'] is not None:
                eer = results[tag_label]['eer']['eer'] * 100

            else:
                eer = None

            output += self.ui.row(
                tag_label,
                results[tag_label]['count']['Nref'],
                results[tag_label]['count']['Nsys'],
                f_measure,
                precision,
                recall,
                eer,
                types=['str', 'int', 'int', 'float1_percentage', 'float1', 'float1', 'float1_percentage']
            ) + '\n'

        return output