def _connect_client(trig_queue):
 t0 = time.time()
 while (((time.time() - t0) < _max_wait) and ((_server is None) or (not _server._running))):
  time.sleep(0.01)
 assert_true(((_server is not None) and _server._running))
 stim_client = StimClient('localhost', port=4218)
 t0 = time.time()
 while (((time.time() - t0) < _max_wait) and (not _have_put_in_trigger)):
  time.sleep(0.01)
 assert_true(_have_put_in_trigger)
 trig_queue.put(stim_client.get_trigger())
 stim_client.close()

def _connect_client ( trig_queue ) : t0 = time . time ( ) while ( ( ( time . time ( ) - t0 ) < _max_wait ) and ( ( _server is None ) or ( not _server . _running ) ) ) : time . sleep ( 0.01 ) assert_true ( ( ( _server is not None ) and _server . _running ) ) stim_client = StimClient ( 'localhost' , port = 4218 ) t0 = time . time ( ) while ( ( ( time . time ( ) - t0 ) < _max_wait ) and ( not _have_put_in_trigger ) ) : time . sleep ( 0.01 ) assert_true ( _have_put_in_trigger ) trig_queue . put ( stim_client . get_trigger ( ) ) stim_client . close ( )
helper method that instantiates the stimclient .