<commit_before>import play
import behavior
import main
import robocup
import evaluation.window_evaluator
import constants
import time

# This isn't a real play, but it's pretty useful
# Turn it on and we'll draw the window evaluator stuff on-screen from the ball to our goal
class DebugWindowEvaluator(play.Play):

    def __init__(self):
        super().__init__(continuous=True)

        self.add_transition(behavior.Behavior.State.start,
            behavior.Behavior.State.running,
            lambda: True,
            'immediately')

        self.avg_time_saved = 0.0
        self.avg_count = 0.0


    def execute_running(self):
        pt = main.ball().pos
        seg = constants.Field.OurGoalSegment

        #win_eval = evaluation.window_evaluator.WindowEvaluator()
        #win_eval.debug = True
        #start = time.time()
        #windows,best = win_eval.eval_pt_to_seg(pt, seg)
        #end = time.time()
        #py_time = end - start

        win_eval_cpp = robocup.WindowEvaluator(main.system_state())
        win_eval_cpp.debug = True
        start = time.time()
        windows,best = win_eval_cpp.eval_pt_to_seg(pt, seg)
        print(' ')
        end = time.time()
        cpp_time = end - start

        # if self.avg_count < 100:
        #     self.avg_time_saved += py_time - cpp_time
        #     self.avg_count += 1
        # else:
        #     print(self.avg_time_saved / self.avg_count)<commit_msg>Removes extra print statement.<commit_after>import play
import behavior
import main
import robocup
import evaluation.window_evaluator
import constants
import time

# This isn't a real play, but it's pretty useful
# Turn it on and we'll draw the window evaluator stuff on-screen from the ball to our goal
class DebugWindowEvaluator(play.Play):

    def __init__(self):
        super().__init__(continuous=True)

        self.add_transition(behavior.Behavior.State.start,
            behavior.Behavior.State.running,
            lambda: True,
            'immediately')

        self.avg_time_saved = 0.0
        self.avg_count = 0.0


    def execute_running(self):
        pt = main.ball().pos
        seg = constants.Field.OurGoalSegment

        #win_eval = evaluation.window_evaluator.WindowEvaluator()
        #win_eval.debug = True
        #start = time.time()
        #windows,best = win_eval.eval_pt_to_seg(pt, seg)
        #end = time.time()
        #py_time = end - start

        win_eval_cpp = robocup.WindowEvaluator(main.system_state())
        win_eval_cpp.debug = True
        start = time.time()
        windows,best = win_eval_cpp.eval_pt_to_seg(pt, seg)
        end = time.time()
        cpp_time = end - start

        # if self.avg_count < 100:
        #     self.avg_time_saved += py_time - cpp_time
        #     self.avg_count += 1
        # else:
        #     print(self.avg_time_saved / self.avg_count)
{'fraction_non_alphanumeric': 0.0934219734079776, 'fraction_numerical': 0.005598320503848845, 'mean_word_length': 2.3674911660777385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3104754', 'n_tokens_mistral': 906, 'n_tokens_neox': 866, 'n_words': 201}