def get_default_shop(request=None):
    from lfs.core.models import Shop
    if request:
        try:
            return request.shop
        except AttributeError:
            pass

    try:
        shop = Shop.objects.get(pk=1)
    except Shop.DoesNotExist, e:  # No guarantee that our shop will have pk=1 in postgres
        shop = Shop.objects.all()[0]

    if request:
        request.shop = shop

    return shop
List
dataset/ETHPy150Open diefenbach/django-lfs/lfs/core/utils.py/get_default_shop--crossover with--dataset/ETHPy150Open algorhythms/LeetCode/024 Reverse Nodes in k-Group.py/Solution.reverseKGroup