def __getRoleBySkill(self, skill): for role, skills in SKILLS_BY_ROLES.iteritems(): if skill.name in skills: return role