<commit_before>import json
import time
import socket

__version__ = "0.1demo"

def update_template():
    return dict(
        name="",
        version="",
        host="",
        instance=0)


def send_update(update, host, port):
    data = json.dumps(update)
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.connect((host, port))
    s.send(data)
    s.close()
    return

if __name__ == '__main__':
    update = update_template()
    update["name"] = 'python_client_demo'
    update["version"] = __version__
    update["host"] = socket.gethostname()
    while True:
        print "Sending update"
        send_update(update, 'localhost', 7777)
        time.sleep(3)

<commit_msg>also print time when sending update<commit_after>import json
import time
import socket

__version__ = "0.1demo"

def update_template():
    return dict(
        name="",
        version="",
        host="",
        instance=0)


def send_update(update, host, port):
    data = json.dumps(update)
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.connect((host, port))
    s.send(data)
    s.close()
    return

if __name__ == '__main__':
    update = update_template()
    update["name"] = 'python_client_demo'
    update["version"] = __version__
    update["host"] = socket.gethostname()
    while True:
        print time.time(), "Sending update"
        send_update(update, 'localhost', 7777)
        time.sleep(3)


{'fraction_non_alphanumeric': 0.13296011196641008, 'fraction_numerical': 0.01119664100769769, 'mean_word_length': 2.9285714285714284, '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': '6304620', 'n_tokens_mistral': 476, 'n_tokens_neox': 466, 'n_words': 106}