def on_data(self, raw_data):
data = json.loads(raw_data)<EOL>if '<STR_LIT>' in data:<EOL><INDENT>status = Status.parse(self.api, data)<EOL>if self.on_status(status) is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in data:<EOL><INDENT>delete = data['<STR_LIT>']['<STR_LIT:status>']<EOL>if self.on_delete(delete['<STR_LIT:id>'], delete['<STR_LIT>']) is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in data:<EOL><INDENT>status = Status.parse(self.api, data)<EOL>if self.on_event(status) is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in data:<EOL><INDENT>status = Status.parse(self.api, data)<EOL>if self.on_direct_message(status) is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in data:<EOL><INDENT>if self.on_friends(data['<STR_LIT>']) is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in data:<EOL><INDENT>if self.on_limit(data['<STR_LIT>']['<STR_LIT>']) is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in data:<EOL><INDENT>if self.on_disconnect(data['<STR_LIT>']) is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in data:<EOL><INDENT>if self.on_warning(data['<STR_LIT>']) is False:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>logging.error("<STR_LIT>" + str(raw_data))<EOL><DEDENT>
Called when raw data is received from connection.

        Override this method if you wish to manually handle
        the stream data. Return False to stop stream and close connection.