def decode(self, input, final=False):
decoder = self._decoder<EOL>if decoder is not None:<EOL><INDENT>return decoder(input, final)<EOL><DEDENT>input = self._buffer + input<EOL>encoding, input = _detect_bom(input)<EOL>if encoding is None:<EOL><INDENT>if len(input) < <NUM_LIT:3> and not final:  <EOL><INDENT>self._buffer = input<EOL>return '<STR_LIT>'<EOL><DEDENT>else:  <EOL><INDENT>encoding = self._fallback_encoding<EOL><DEDENT><DEDENT>decoder = encoding.codec_info.incrementaldecoder(self._errors).decode<EOL>self._decoder = decoder<EOL>self.encoding = encoding<EOL>return decoder(input, final)<EOL>
Decode one chunk of the input.

        :param input: A byte string.
        :param final:
            Indicate that no more input is available.
            Must be :obj:`True` if this is the last call.
        :returns: An Unicode string.