def group_and_bridge(kwargs):
    """
    Given kwargs from the view (with view specific keys popped) pull out the
    bridge and fetch group from database.
    """

    bridge = kwargs.pop("bridge", None)

    if bridge:
        try:
            group = bridge.get_group(**kwargs)
        except __HOLE__:
            raise Http404
    else:
        group = None

    return group, bridge
dataset/ETHPy150Open amarandon/smeuhsocial/apps/account/views.py/group_and_bridge