<commit_before>#!/usr/bin/python
import zmq,sys

endpoint = "tcp://localhost:60201"
subscription = ""
if len(sys.argv)>1:
    subscription=sys.argv[1]
if len(sys.argv)>2:
    endpoint=sys.argv[2]

#  Prepare our context and sockets
context = zmq.Context()
socket = context.socket(zmq.SUB)
print "connect to: "+endpoint
socket.connect(str(endpoint))
print "subscribe to: "+subscription
socket.setsockopt(zmq.SUBSCRIBE, subscription)

while True:
  msg = socket.recv_multipart();
  print "topic: "+str(msg[0])
  print "messagesize: "+str(sys.getsizeof(msg[1]))
<commit_msg>better output from test script<commit_after>#!/usr/bin/python
import zmq,sys

endpoint = "tcp://localhost:60201"
subscription = ""
if len(sys.argv)>1:
    subscription=sys.argv[1]
if len(sys.argv)>2:
    endpoint=sys.argv[2]

#  Prepare our context and sockets
context = zmq.Context()
socket = context.socket(zmq.SUB)
print "connect to: "+endpoint
socket.connect(str(endpoint))
print "subscribe to: "+subscription
socket.setsockopt(zmq.SUBSCRIBE, subscription)

while True:
  msg = socket.recv_multipart();
  print "_________________________"
  i=0;
  for message in msg:
    if i==0:
      print "topic: "+str(message)
      i=1
    elif i==1:
      print "  messagesize: "+str(sys.getsizeof(message))
      i=0

{'fraction_non_alphanumeric': 0.14719626168224298, 'fraction_numerical': 0.019470404984423675, 'mean_word_length': 4.788288288288288, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1056556', 'n_tokens_mistral': 453, 'n_tokens_neox': 447, 'n_words': 100}