def METHOD_NAME(org_role: OrganizationRole) -> TeamRole:
    if org_role is organization_roles.get_top_dog():
        return team_roles.get_top_dog()
    for team_role in reversed(team_roles.get_all()):
        mapped_org_role = get_mapped_org_role(team_role)
        if mapped_org_role and mapped_org_role.priority <= org_role.priority:
            return team_role
    return team_roles.get_default()