<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mark_seen(self):
 """ Mark the selected message or comment as seen. """

        data = self.get_selected_item()
        if data['is_new']:
            with self.term.loader('Marking as read'):
                data['object'].mark_as_read()
            if not self.term.loader.exception:
                data['is_new'] = False
        else:
            with self.term.loader('Marking as unread'):
                data['object'].mark_as_unread()
            if not self.term.loader.exception:
                data['is_new'] = True