@check_ready<EOL><INDENT>def display_outputs(self, groupby="<STR_LIT:type>"):<DEDENT>
if self._single_result:<EOL><INDENT>self._display_single_result()<EOL>return<EOL><DEDENT>stdouts = self.stdout<EOL>stderrs = self.stderr<EOL>pyouts  = self.pyout<EOL>output_lists = self.outputs<EOL>results = self.get()<EOL>targets = self.engine_id<EOL>if groupby == "<STR_LIT>":<EOL><INDENT>for eid,stdout,stderr,outputs,r,pyout in zip(<EOL>targets, stdouts, stderrs, output_lists, results, pyouts<EOL>):<EOL><INDENT>self._display_stream(stdout, '<STR_LIT>' % eid)<EOL>self._display_stream(stderr, '<STR_LIT>' % eid, file=sys.stderr)<EOL>try:<EOL><INDENT>get_ipython()<EOL><DEDENT>except NameError:<EOL><INDENT>return <EOL><DEDENT>if outputs or pyout is not None:<EOL><INDENT>_raw_text('<STR_LIT>' % eid)<EOL><DEDENT>for output in outputs:<EOL><INDENT>self._republish_displaypub(output, eid)<EOL><DEDENT>if pyout is not None:<EOL><INDENT>display(r)<EOL><DEDENT><DEDENT><DEDENT>elif groupby in ('<STR_LIT:type>', '<STR_LIT>'):<EOL><INDENT>for eid,stdout in zip(targets, stdouts):<EOL><INDENT>self._display_stream(stdout, '<STR_LIT>' % eid)<EOL><DEDENT>for eid,stderr in zip(targets, stderrs):<EOL><INDENT>self._display_stream(stderr, '<STR_LIT>' % eid, file=sys.stderr)<EOL><DEDENT>try:<EOL><INDENT>get_ipython()<EOL><DEDENT>except NameError:<EOL><INDENT>return<EOL><DEDENT>if groupby == '<STR_LIT>':<EOL><INDENT>output_dict = dict((eid, outputs) for eid,outputs in zip(targets, output_lists))<EOL>N = max(len(outputs) for outputs in output_lists)<EOL>for i in range(N):<EOL><INDENT>for eid in targets:<EOL><INDENT>outputs = output_dict[eid]<EOL>if len(outputs) >= N:<EOL><INDENT>_raw_text('<STR_LIT>' % eid)<EOL>self._republish_displaypub(outputs[i], eid)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for eid,outputs in zip(targets, output_lists):<EOL><INDENT>if outputs:<EOL><INDENT>_raw_text('<STR_LIT>' % eid)<EOL><DEDENT>for output in outputs:<EOL><INDENT>self._republish_displaypub(output, eid)<EOL><DEDENT><DEDENT><DEDENT>for eid,r,pyout in zip(targets, results, pyouts):<EOL><INDENT>if pyout is not None:<EOL><INDENT>display(r)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % groupby)<EOL><DEDENT>
republish the outputs of the computation

        Parameters
        ----------

        groupby : str [default: type]
            if 'type':
                Group outputs by type (show all stdout, then all stderr, etc.):

                [stdout:1] foo
                [stdout:2] foo
                [stderr:1] bar
                [stderr:2] bar
            if 'engine':
                Display outputs for each engine before moving on to the next:

                [stdout:1] foo
                [stderr:1] bar
                [stdout:2] foo
                [stderr:2] bar

            if 'order':
                Like 'type', but further collate individual displaypub
                outputs.  This is meant for cases of each command producing
                several plots, and you would like to see all of the first
                plots together, then all of the second plots, and so on.