<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_characters(self, character_page):
 """Parses the DOM and returns media character attributes in the sidebar. :type character_page: :class:`bs4.BeautifulSoup` :param character_page: MAL character page's DOM :rtype: dict :return: character attributes. """

    media_info = self.parse_sidebar(character_page)

    try:
      character_title = filter(lambda x: u'Characters' in x.text, character_page.find_all(u'h2'))
      media_info[u'characters'] = {}
      if character_title:
        character_title = character_title[0]
        curr_elt = character_title.find_next_sibling(u'table')
        while curr_elt:
          curr_row = curr_elt.find(u'tr')
          # character in second col.
          character_col = curr_row.find_all(u'td', recursive=False)[1]
          character_link = character_col.find(u'a')
          character_name = ' '.join(reversed(character_link.text.split(u', ')))
          link_parts = character_link.get(u'href').split(u'/')
          # of the form /character/7373/Holo
          character = self.session.character(int(link_parts[2])).set({'name': character_name})
          role = character_col.find(u'small').text
          media_info[u'characters'][character] = {'role': role}
          curr_elt = curr_elt.find_next_sibling(u'table')
    except:
      if not self.session.suppress_parse_exceptions:
        raise

    return media_info