<commit_before>import pygame
import socket
import struct
#import binascii
import time
from pygame.locals import *

adress = ("127.0.0.1", 1000)

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

pygame.init()
joystick_count=pygame.joystick.get_count()
if joystick_count == 0:
    # No joysticks!
    print ("Error, I didn't find any joysticks.")
else:
        # Use joystick #0 and initialize it
        print ("init")
        fir_joystick = pygame.joystick.Joystick(0)
        fir_joystick.init()
        sec_joystick = pygame.joystick.Joystick(1)
        sec_joystick.init()

        

done = False

while done==False:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
                done=True
                continue

    vertAx1 = fir_joystick.get_axis(1)
    horAxis1 = fir_joystick.get_axis(0)
    vertAx2 = sec_joystick.get_axis(1)
    horAxis2 = sec_joystick.get_axis(0)

    values = (vertAx1, horAxis1, vertAx2, horAxis2 )
    s = struct.Struct('f f f f')
    packet_data = s.pack(*values)

    message = "One" + str(horAxis1) + ", " + str(vertAx1) + " Two" + str(horAxis2) + ", " + str(vertAx2)

    sock.sendto(message, adress) 
    #sock.sendto(binascii.hexlify(packet_data), (IP, PORT))
    
   
    print("x1")

    print(horAxis1)

    print("y1")
    
<commit_msg>Normalize code added<commit_after>import pygame
import socket
import struct
#import binascii
import time
from pygame.locals import *

adress = ("127.0.0.1", 1000)

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

pygame.init()
joystick_count=pygame.joystick.get_count()
if joystick_count == 0:
    # No joysticks!
    print ("Error, I didn't find any joysticks.")
else:
    # Use joystick #0 and initialize it
    print ("init")
    fir_joystick = pygame.joystick.Joystick(0)
    fir_joystick.init()
    sec_joystick = pygame.joystick.Joystick(1)
    sec_joystick.init()

        

done = False

def normalize(value):
    return int(value * 180)

while done==False:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done=True
            continue

    vertAx1 = normalize(fir_joystick.get_axis(1))
    horAxis1 = normalize(fir_joystick.get_axis(0))
    vertAx2 = normalize(sec_joystick.get_axis(1))
    horAxis2 = normalize(sec_joystick.get_axis(0))

    values = (vertAx1, horAxis1, vertAx2, horAxis2 )
    s = struct.Struct('f f f f')
    packet_data = s.pack(*values)

    message = "One" + str(horAxis1) + ", " + str(vertAx1) + " Two" + str(horAxis2) + ", " + str(vertAx2)

    sock.sendto(message, adress) 
    #sock.sendto(binascii.hexlify(packet_data), (IP, PORT))
    
   
    print("x1")

    print(horAxis1)

    print("y1")
    

{'fraction_non_alphanumeric': 0.12666666666666668, 'fraction_numerical': 0.025555555555555557, 'mean_word_length': 3.019345238095238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5575400', 'n_tokens_mistral': 1068, 'n_tokens_neox': 977, 'n_words': 199}