def METHOD_NAME(cls, role) -> Tuple[RoleScope, RoleType]:
    """Parse roles according to the expected values from the specs."""
    role_parts = {}
    for regex in cls._ROLE_REGEXP:
        if match := regex.match(role):
            role_parts = match.groupdict()
            break
    # No scope, default to the narrowest, COURSE
    scope = cls._SCOPE_MAP.get(role_parts.get("scope"), RoleScope.COURSE)
    # In system and institution roles the main type is "person"
    if role_parts.get("type") == "person":
        role_parts["type"] = role_parts["sub_type"]
    type_ = cls._TYPE_MAP.get(role_parts.get("type"), RoleType.LEARNER)
    return scope, type_