<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bookmarks(self):
 """Get list of bookmarks"""

        cmd = [HG, 'bookmarks']
        output = self._command(cmd).decode(self.encoding, 'replace')
        if output.startswith('no bookmarks set'):
            return []
        results = []
        for line in output.splitlines():
            m = bookmarks_rx.match(line)
            assert m, 'unexpected output: ' + line
            results.append(m.group('name'))
        return results