<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def open_link(self):
 """ Open the link contained in the selected item. If there is more than one link contained in the item, prompt the user to choose which link to open. """

        data = self.get_selected_item()
        if data['type'] == 'Submission':
            link = self.prompt_and_select_link()
            if link:
                self.config.history.add(link)
                self.term.open_link(link)
        elif data['type'] == 'Comment':
            link = self.prompt_and_select_link()
            if link:
                self.term.open_link(link)
        else:
            self.term.flash()