<commit_before>import socket
import sys
import json


class UdpClient:
    def __init__(self, ip, port):
        self.ip = ip
        self.port = port
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

    def send_request(self, cmd):
        try:
            self.sock.sendto(cmd, (self.ip, self.port))
            data = self.sock.recvfrom(2048)

            return data[0]
        except:
            print('UDP Connection Error: ', sys.exc_info()[0])
            raise

    def set_light(self, bright, red, green, blue, active_bulb):
        cmd = '{"cmd":"light_ctrl","bright":"' + str(bright) + '","g":"' + str(green) + '","b":"' + str(blue) + '","effect":"9","r":"' + str(red) + '","sn_list":[{"sn":"' + active_bulb + '"}],"matchValue":"0","iswitch":"1"}'

        data = self.send_request(cmd)

    def set_title(self, sn, title):
        cmd = '{"cmd":"set_title","sn":"' + sn + '","title":"' + title + '"}'

        data = self.send_request(cmd)

    def get_lights(self):
        cmd = '{"cmd":"light_list"}'

        data = self.send_request(cmd)<commit_msg>UDP client line length correction.<commit_after>import socket
import sys
import json


class UdpClient:
    def __init__(self, ip, port):
        self.ip = ip
        self.port = port
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

    def send_request(self, cmd):
        try:
            self.sock.sendto(cmd, (self.ip, self.port))
            data = self.sock.recvfrom(2048)

            return data[0]
        except:
            print('UDP Connection Error: ', sys.exc_info()[0])
            raise

    def set_light(self, bright, red, green, blue, active_bulb):
        cmd = '{"cmd":"light_ctrl","bright":"' + str(bright) +\
              '","g":"' + str(green) +\
              '","b":"' + str(blue) +\
              '","effect":"9","r":"' + str(red) +\
              '","sn_list":[{"sn":"' + active_bulb +\
              '"}],"matchValue":"0","iswitch":"1"}'

        data = self.send_request(cmd)

    def set_title(self, sn, title):
        cmd = '{"cmd":"set_title","sn":"' + sn + '","title":"' + title + '"}'

        data = self.send_request(cmd)

    def get_lights(self):
        cmd = '{"cmd":"light_list"}'

        data = self.send_request(cmd)
{'fraction_non_alphanumeric': 0.19261213720316622, 'fraction_numerical': 0.0079155672823219, 'mean_word_length': 2.4107946026986506, 'pattern_counts': {'":': 28, '<': 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': '3655907', 'n_tokens_mistral': 776, 'n_tokens_neox': 746, 'n_words': 151}