<commit_before>from django.conf import settings


def menu_leagues(request):
    from ultimate.leagues.models import League

    leagues = League.objects.filter(state__in=['closed', 'open', 'preview'])
    leagues = [league for league in leagues if league.is_visible(request.user)]

    return {'menu_leagues': leagues}


def menu_items_nav(request):
    from ultimate.index.models import StaticMenuItems
<commit_msg>fix league menu ordering<commit_after>from django.conf import settings


def menu_leagues(request):
    from ultimate.leagues.models import League

    leagues = League.objects.filter(state__in=['closed', 'open', 'preview']).reverse()
    leagues = [league for league in leagues if league.is_visible(request.user)]

    return {'menu_leagues': leagues}


def menu_items_nav(request):
    from ultimate.index.models import StaticMenuItems

{'fraction_non_alphanumeric': 0.10175438596491228, 'fraction_numerical': 0.0, 'mean_word_length': 5.070921985815603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '910439', 'n_tokens_mistral': 255, 'n_tokens_neox': 238, 'n_words': 65}