<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_roles(self, username):
 """ Get roles of a user @str username: name of the user @rtype: dict, format { 'roles': [<list of roles>], 'unusedgroups': [<list of groups not matching roles>] } """

        groups = self._get_groups(username)
        user_roles = self.roles.get_roles(groups)
        cherrypy.log.error(
            msg="user '" + username + "' roles: " + str(user_roles),
            severity=logging.DEBUG,
        )
        return user_roles