def data_received(self, data):
self._data_buffer += data.decode()<EOL>if not self._data_buffer.endswith('<STR_LIT:\r\n>'):<EOL><INDENT>return<EOL><DEDENT>data = self._data_buffer<EOL>self._data_buffer = '<STR_LIT>'  <EOL>for cmd in data.strip().split('<STR_LIT:\r\n>'):<EOL><INDENT>data = json.loads(cmd)<EOL>if not isinstance(data, list):<EOL><INDENT>data = [data]<EOL><DEDENT>for item in data:<EOL><INDENT>self.handle_data(item)<EOL><DEDENT><DEDENT>
Handle received data.