def _which_display(self, log: str, output: str) -> HTML:
        """
        Determines if the log or lst should be returned as the results for the cell based on parsing the log
        looking for errors and the presence of lst output.

        :param log: str log from code submission
        :param output: None or str lst output if there was any
        :return: The correct results based on log and lst
        :rtype: str
        """
        lines = re.split(r'[\n]\s*', log)
        i = 0
        elog = []
        for line in lines:
            i += 1
            e = []
            if line.startswith('ERROR'):
                logger.debug("In ERROR Condition")
                e = lines[(max(i - 15, 0)):(min(i + 16, len(lines)))]
            elog = elog + e
        tlog = '\n'.join(elog)
        logger.debug("elog count: " + str(len(elog)))
        logger.debug("tlog: " + str(tlog))

        color_log = highlight(log, SASLogLexer(), HtmlFormatter(full=True, style=SASLogStyle, lineseparator="<br>"))
        # store the log for display in the showSASLog nbextension
        self.cachedlog = color_log
        # Are there errors in the log? if show the lines on each side of the error
        if len(elog) == 0 and len(output) > self.lst_len:  # no error and LST output
            debug1 = 1
            logger.debug("DEBUG1: " + str(debug1) + " no error and LST output ")
            return HTML(output)
        elif len(elog) == 0 and len(output) <= self.lst_len:  # no error and no LST
            debug1 = 2
            logger.debug("DEBUG1: " + str(debug1) + " no error and no LST")
            return HTML(color_log)
        elif len(elog) > 0 and len(output) <= self.lst_len:  # error and no LST
            debug1 = 3
            logger.debug("DEBUG1: " + str(debug1) + " error and no LST")
            return HTML(color_log)
        else:  # errors and LST
            debug1 = 4
            logger.debug("DEBUG1: " + str(debug1) + " errors and LST")
            return HTML(color_log + output)
Determines if the log or lst should be returned as the results for the cell based on parsing the log
        looking for errors and the presence of lst output.

        :param log: str log from code submission
        :param output: None or str lst output if there was any
        :return: The correct results based on log and lst
        :rtype: str