<commit_before>#!/usr/bin/env python3
# -*- coding: utf8 -*-

import datetime

from smserver.smutils import smpacket
from smserver.stepmania_controller import StepmaniaController
from smserver import models
from smserver.models import ranked_chart
from smserver.models import song_stat

from smserver.chathelper import with_color


class GameOverController(StepmaniaController):
    command = smpacket.SMClientCommand.NSCGON
    require_login = True

    def handle(self):
        if not self.room:
            return

        if "start_at" not in self.conn.songstats:
            return

        song_duration = datetime.datetime.now() - self.conn.songstats["start_at"]

        for user in self.active_users:
            user.status = 2
            ssr = 0
            with self.conn.mutex:
                print(self.conn.songstats[user.pos]["chartkey"])
                if self.conn.songstats[user.pos]["taps"] > 0:
                    self.conn.songstats[user.pos]["dppercent"] = (self.conn.songstats[user.pos]["dp"] * 100 
                        / (self.conn.songstats[user.pos]["taps"] * 2))
                else:
                    self.conn.songstats[user.pos]["dppercent"] = 0
                rate = self.conn.songstats[user.pos]["rate"]<commit_msg>Forgot to remove this print<commit_after>#!/usr/bin/env python3
# -*- coding: utf8 -*-

import datetime

from smserver.smutils import smpacket
from smserver.stepmania_controller import StepmaniaController
from smserver import models
from smserver.models import ranked_chart
from smserver.models import song_stat

from smserver.chathelper import with_color


class GameOverController(StepmaniaController):
    command = smpacket.SMClientCommand.NSCGON
    require_login = True

    def handle(self):
        if not self.room:
            return

        if "start_at" not in self.conn.songstats:
            return

        song_duration = datetime.datetime.now() - self.conn.songstats["start_at"]

        for user in self.active_users:
            user.status = 2
            ssr = 0
            with self.conn.mutex:
                if self.conn.songstats[user.pos]["taps"] > 0:
                    self.conn.songstats[user.pos]["dppercent"] = (self.conn.songstats[user.pos]["dp"] * 100 
                        / (self.conn.songstats[user.pos]["taps"] * 2))
                else:
                    self.conn.songstats[user.pos]["dppercent"] = 0
                rate = self.conn.songstats[user.pos]["rate"]
{'fraction_non_alphanumeric': 0.10562525293403481, 'fraction_numerical': 0.008093889113719142, 'mean_word_length': 2.3181208053691273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6794716', 'n_tokens_mistral': 762, 'n_tokens_neox': 704, 'n_words': 152}