def cluster_info(ipyclient, spacer="<STR_LIT>"):
<EOL>hosts = []<EOL>for eid in ipyclient.ids:<EOL><INDENT>engine = ipyclient[eid]<EOL>if not engine.outstanding:<EOL><INDENT>hosts.append(engine.apply(_socket.gethostname))<EOL><DEDENT><DEDENT>hosts = [i.get() for i in hosts]<EOL>result = []<EOL>for hostname in set(hosts):<EOL><INDENT>result.append("<STR_LIT>".format(spacer, hosts.count(hostname), hostname))<EOL><DEDENT>print("<STR_LIT:\n>".join(result))<EOL>
reports host and engine info for an ipyclient