@classmethod
    def collect_tokens(cls, parseresult, mode):
        """
        Collect the tokens from a (potentially) nested parse result.
        """
        inner = '(%s)' if mode=='parens' else '[%s]'
        if parseresult is None: return []
        tokens = []
        for token in parseresult.asList():
            # If value is a tuple, the token will be a list
            if isinstance(token, list):
                tokens[-1] = tokens[-1] + (''.join(token) % inner)
            else:
                if token.strip() == ',': continue
                tokens.append(cls._strip_commas(token))
        return tokens
dataset/ETHPy150Open ioam/holoviews/holoviews/ipython/parser.py/Parser.collect_tokens/swapped operands of `%`