import six
from subprocess import Popen, PIPE


def run_ipcluster(n=4):
    if six.PY2:
        cmd = 'ipcluster'
    elif six.PY3:
        cmd = 'ipcluster3'
    else:
        raise NotImplementedError("Not run with Python 2 *or* 3?")

    engines = "--engines=MPIEngineSetLauncher"
    rval = Popen([cmd, 'start', '-n', str(n), engines, str('&')],
                 stdout=PIPE, stderr=PIPE)


if __name__ == '__main__':
    run_ipcluster()

@@ -65,16 +65,229 @@
 r(n=4):%0A
+    %22%22%22Convenient way to start an ipcluster for testing.%0A%0A    You have to wait for it to start, however.%0A    %22%22%22%0A    # FIXME: This should be reimplemented to signal when the cluster has%0A    # successfully started%0A
     if s

Add a docstring to `run_ipcluster`.