def get_page_instance(context):
    """
    Given a template context, try and find a Page variable in the common
    places. Returns None if a page can not be found.
    """
    possible_names = [PAGE_TEMPLATE_VAR, 'self']
    for name in possible_names:
        if context in name:
            page = context[name]
            if isinstance(page, Page):
                return page
dataset/ETHPy150Open torchbox/wagtail/wagtail/wagtailadmin/templatetags/wagtailuserbar.py/get_page_instance/swapped operands of `in`