def decode(self, code, terminator='<STR_LIT>'):
if code:<EOL><INDENT>if terminator not in code:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'.format(<EOL>terminator if terminator != '<STR_LIT>' else '<STR_LIT>'<EOL>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>wordlist = ['<STR_LIT>'] * len(code)<EOL>for i in range(len(code)):<EOL><INDENT>wordlist = sorted(<EOL>code[i] + wordlist[i] for i in range(len(code))<EOL>)<EOL><DEDENT>rows = [w for w in wordlist if w[-<NUM_LIT:1>] == terminator][<NUM_LIT:0>]<EOL>return rows.rstrip(terminator)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>
r"""Return a word decoded from BWT form.

        Parameters
        ----------
        code : str
            The word to transform from BWT form
        terminator : str
            A character added to signal the end of the string

        Returns
        -------
        str
            Word decoded by BWT

        Raises
        ------
        ValueError
            Specified terminator absent from code.

        Examples
        --------
        >>> bwt = BWT()
        >>> bwt.decode('n\x00ilag')
        'align'
        >>> bwt.decode('annb\x00aa')
        'banana'
        >>> bwt.decode('annb@aa', '@')
        'banana'