<commit_before>import socket
import sys
import time

# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# Connect the socket to the port where the server is listening
ip = "192.168.3.11"
port = 4002

server_address = (ip, port)
print("Connecting...")
sock.connect(server_address)
print("Connected to", ip, "with port", port)

try:

    # Send data
    message = "#04" + str(chr(13))
    print('Sending "%s"' % message)
    sock.send(message.encode('utf-8'))

    # Look for the response
    amount_received = 0
    amount_expected = 9

    dChar = []
    while amount_received < amount_expected:
        data = sock.recv(1)
        amount_received += len(data)
        dataFull = str(data,'utf-8')

        dVal = dataFull
        dChar.append(dVal)

    dataRes = float(dChar[2] + dChar[3] + dChar[4] + dChar[5] + dChar[6] + dChar[7])
    print(dataRes)


finally:
    print('Closing Socket...')
    sock.close()
    print('Socket closed!')
<commit_msg>Trying to integrate calculator into socket<commit_after>import socket
import sys
import time

def space():
    print()
    print()

# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# Connect the socket to the port where the server is listening
ip = "192.168.3.11"
port = 4002

server_address = (ip, port)
print("Connecting...")
sock.connect(server_address)
print("Connected to", ip, "with port", port)

try:

    # Send data
    message = "#04" + str(chr(13))
    print('Sending "%s"' % message)
    sock.send(message.encode('utf-8'))

    # Look for the response
    amount_received = 0
    amount_expected = 9

    dChar = []
    while amount_received < amount_expected:
        data = sock.recv(1)
        amount_received += len(data)
        dataFull = str(data,'utf-8')

        dVal = dataFull
        dChar.append(dVal)

    dataRes = float(dChar[2] + dChar[3] + dChar[4] + dChar[5] + dChar[6] + dChar[7])
    print(dataRes)


    R = float(input("R = %s" + str(chr(13))) % dataRes)
    t = ((((-R_0)*a) + math.sqrt((R_0 ** 2) * (a ** 2) - 4 * R_0 * b * (R_0 - R))) / (2 * R_0 * b))
    space()
    if(t == -0.0):
        print("t = 0 C")
    else:
        print("t =",t,"C")


finally:
    print('Closing Socket...')
    sock.close()
    print('Socket closed!')

{'fraction_non_alphanumeric': 0.15458515283842794, 'fraction_numerical': 0.03056768558951965, 'mean_word_length': 2.9028960817717206, 'pattern_counts': {'":': 0, '<': 5, '<?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': '874473', 'n_tokens_mistral': 860, 'n_tokens_neox': 805, 'n_words': 205}