<commit_before>import time
import pygame
from pygame.locals import *
import serial

#try:
if True:
  from pymavlink import mavutil
  isMavlinkInstalled = True
except:
  isMavlinkInstalled = False
HEARTBEAT_SAMPLE_TIME = 1
ORDER_SAMPLE_TIME = 0.05
  
buttons_state             = 0 # Variable to store buttons state

# Use pygame for the joystick

JOY_RECONNECT_TIME = 2 #seconds. Time to reconnect if no joystick motion
FORWARD_BACKWARD_AXIS = 2
LEFT_RIGHT_AXIS       = 3
pygame.init()
global cmd1, cmd2
cmd1 = 0
cmd2 = 0
def resetOrder():
  global cmd1, cmd2
  cmd1 = 0
  cmd2 = 0

# Read mavlink messages
if isMavlinkInstalled:
  try:
    ground_station = 'localhost:14555'
    master_forward = mavutil.mavlink_connection(ground_station, baud=57600, source_system=254) # 255 is ground station<commit_msg>Correct a stupid bug...<commit_after>import time
import pygame
from pygame.locals import *
import serial

#try:
try:
  from pymavlink import mavutil
  isMavlinkInstalled = True
except:
  isMavlinkInstalled = False
HEARTBEAT_SAMPLE_TIME = 1
ORDER_SAMPLE_TIME = 0.05
  
buttons_state             = 0 # Variable to store buttons state

# Use pygame for the joystick

JOY_RECONNECT_TIME = 2 #seconds. Time to reconnect if no joystick motion
FORWARD_BACKWARD_AXIS = 2
LEFT_RIGHT_AXIS       = 3
pygame.init()
global cmd1, cmd2
cmd1 = 0
cmd2 = 0
def resetOrder():
  global cmd1, cmd2
  cmd1 = 0
  cmd2 = 0

# Read mavlink messages
if isMavlinkInstalled:
  try:
    ground_station = 'localhost:14555'
    master_forward = mavutil.mavlink_connection(ground_station, baud=57600, source_system=254) # 255 is ground station
{'fraction_non_alphanumeric': 0.06373762376237624, 'fraction_numerical': 0.04455445544554455, 'mean_word_length': 4.149681528662421, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6673486', 'n_tokens_mistral': 617, 'n_tokens_neox': 563, 'n_words': 169}