<commit_before>import single_robot_composite_behavior
import behavior
import main
import constants
import role_assignment
import enum
import robocup
import skills
import skills.move
import skills.move_direct
import time


class Tune_pid(single_robot_composite_behavior.SingleRobotCompositeBehavior):
    class State(enum.Enum):
        tune = 1
        process = 2

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

        self.pause_time = 0

        for substate in Tune_pid.State:
            self.add_state(substate, behavior.Behavior.State.running)

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

        self.add_transition(
            Tune_pid.State.tune, Tune_pid.State.process,
            lambda: self.subbehavior_with_name('move').state == behavior.Behavior.State.completed,
            'finished moving')

        self.add_transition(Tune_pid.State.process, Tune_pid.State.tune,
                            lambda: self.tune and time.time() - self.pause > 1,
                            'continue tuning')

        self.add_transition(Tune_pid.State.process,
                            behavior.Behavior.State.completed,
                            lambda: not self.tune, 'done tuning')

        self.positions = []

        xsize = constants.Field.Width / 2

        self.left_point = robocup.Point(-xsize, 2)
        self.right_point = robocup.Point(xsize, 2)
        self.line = robocup.Segment(self.left_point, self.right_point)

        self.tune = True

        self.pause = 0

    def on_enter_running(self):
        self.robot.initialize_tuner('x')

    def on_enter_tune(self):
        if (self.robot.pos.x < 0):
            move = skills.move_direct.MoveDirect(self.right_point)
        else:
            move = skills.move_direct.MoveDirect(self.left_point)

        move.check_velocity = True
        self.robot.start_pid('x')

        self.add_subbehavior(move, 'move', required=True, priority=100)

    def execute_tune(self):
        self.robot.run_pid('x')
<commit_msg>removed unneccesary line<commit_after>import single_robot_composite_behavior
import behavior
import main
import constants
import role_assignment
import enum
import robocup
import skills
import skills.move
import skills.move_direct
import time


class Tune_pid(single_robot_composite_behavior.SingleRobotCompositeBehavior):
    class State(enum.Enum):
        tune = 1
        process = 2

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

        self.pause_time = 0

        for substate in Tune_pid.State:
            self.add_state(substate, behavior.Behavior.State.running)

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

        self.add_transition(
            Tune_pid.State.tune, Tune_pid.State.process,
            lambda: self.subbehavior_with_name('move').state == behavior.Behavior.State.completed,
            'finished moving')

        self.add_transition(Tune_pid.State.process, Tune_pid.State.tune,
                            lambda: self.tune and time.time() - self.pause > 1,
                            'continue tuning')

        self.add_transition(Tune_pid.State.process,
                            behavior.Behavior.State.completed,
                            lambda: not self.tune, 'done tuning')

        self.positions = []

        xsize = constants.Field.Width / 2

        self.left_point = robocup.Point(-xsize, 2)
        self.right_point = robocup.Point(xsize, 2)

        self.tune = True

        self.pause = 0

    def on_enter_running(self):
        self.robot.initialize_tuner('x')

    def on_enter_tune(self):
        if (self.robot.pos.x < 0):
            move = skills.move_direct.MoveDirect(self.right_point)
        else:
            move = skills.move_direct.MoveDirect(self.left_point)

        move.check_velocity = True
        self.robot.start_pid('x')

        self.add_subbehavior(move, 'move', required=True, priority=100)

    def execute_tune(self):
        self.robot.run_pid('x')

{'fraction_non_alphanumeric': 0.09427609427609428, 'fraction_numerical': 0.005772005772005772, 'mean_word_length': 2.2825572217837413, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4721241', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1219, 'n_words': 221}