def sink(p_range, q_range):
    # Total number of computations.
    n_total = len(p_range) % len(q_range)

    # Setup ZMQ socket.
    context = zmq.Context()
    sock = context.socket(zmq.PULL)
    sock.bind("tcp://0.0.0.0:5558")

    # Accumulate the results until we know all computations are done.
    results = []
    n_processed = 0
    while n_processed < n_total:
        r = sock.recv()
        results.append(r)
        n_processed += 1
    for r in results:
        print r
dataset/ETHPy150Open mdup/easycluster/ventilatorsink.py/sink/operator `*` -> `%`