def test_action(aname, args, modelResult):

  if aname == 'send_call':
    def wait_for_return():
        (msg,) = args # extract msg from args tuple, like msg = args[0]
        nchars = connection.sender.send(msg)
        observation.queue.append(('send_return', (nchars,)))
        event.set() # notify pmt that data has been added to queue
    t = threading.Thread(target=wait_for_return)
    t.start()
    return None # pmt will check observation_queue

  elif aname == 'recv_call':
    def wait_for_return():
        (bufsize,) = args
        data = connection.receiver.recv(bufsize)
        observation.queue.append(('recv_return', (data,)))
        event.set() # notify pmt that data has been added to queue
    t = threading.Thread(target=wait_for_return)
    t.start()
    return None # pmt will check observation_queue

  else:
    raise NotImplementedError, 'action not supported by stepper: %s' % aname
In the test_action branch for each controllable action, the code for
dataset/ETHPy150Open jon-jacky/PyModel/samples/Socket/stepper_a.py/test_action