

def get_parent_active_language_choices(parent_object, exclude_current=False):
    "\n    .. versionadded:: 1.0\n\n    Get the currently active languages of an parent object.\n\n    Note: if there is no content at the page, the language won't be returned.\n    "
    assert (parent_object is not None), 'Missing parent_object!'
    from .db import ContentItem
    qs = ContentItem.objects.parent(parent_object, limit_parent_language=False).values_list('language_code', flat=True).distinct()
    languages = set(qs)
    if exclude_current:
        parent_lang = get_parent_language_code(parent_object)
        try:
            languages.remove(parent_lang)
        except KeyError:
            pass
    choices = [(qs, str(get_language_title(lang))) for lang in languages if lang]
    choices.sort(key=(lambda tup: tup[1]))
    return choices

dataset/ETHPy150Open edoburu/django-fluent-contents/fluent_contents/models/managers.py get_parent_active_language_choices/VarMisuse@104/219 `lang`->`qs`