def METHOD_NAME(queryset, model):
    # It is very important to test queryset Noneness with `is None` because the queryset gets otherwise
    # evaluated in bool() context. So here is a function not to forget that.
    if queryset is None:
        queryset = model.objects
        if hasattr(queryset, 'existing'):
            queryset = queryset.existing()
    return queryset