def _translate_page_into(page, language, default=None):
    # Optimisation shortcut: No need to dive into translations if page already what we want
    if page.language == language:
        return page

    translations = dict((t.language, t) for t in page.available_translations())
    translations[page.language] = page

    if language in translations:
        return translations[language]
    else:
        if hasattr(default, '__call__'):
            return default(page=page)
        return default

# ------------------------------------------------------------------------
Do web automation debug
dataset/ETHPy150Open django-leonardo/django-leonardo/leonardo/module/nav/templatetags/webcms_nav_tags.py/_translate_page_into--crossover with--dataset/ETHPy150Open idumpling/robotx/robotx/lib/DebugLibrary.py/DebugCmd.do_web