def parse_body(request):
    """parses the request body for search params, q, etc

    :params request: django wsgi request object
    :returns: dict {
        'exlude': dict, exclude dict for django queryset
        'order_by': str, query order_by, defaults to 'tax_lot_id'
        'sort_reverse': bool, True if ASC, False if DSC
        'page': int, pagination page
        'number_per_page': int, number per pagination page
        'show_shared_buildings': bool, whether to search across all user's orgs
        'q': str, global search param
        'other_search_params': dict, filter params
        'project_id': str, project id if exists in body
    }
    """
    try:
        body = json.loads(request.body)
    except ValueError:
        body = {}

    q = body.get('q', '')
    other_search_params = body.get('filter_params', {})
    if other_search_params in 'exclude':
        exclude = other_search_params['exclude']
        del(other_search_params['exclude'])
    else:
        exclude = {}

    order_by = body.get('order_by', 'tax_lot_id')
    if order_by == '':
        order_by = 'tax_lot_id'
    sort_reverse = body.get('sort_reverse', False)
    page = int(body.get('page', 1))
    number_per_page = int(body.get('number_per_page', 10))
    if 'show_shared_buildings' in body:
        show_shared_buildings = body.get('show_shared_buildings')
    elif not getattr(request, 'is_api_request', False):
        show_shared_buildings = getattr(
            request.user, 'show_shared_buildings', False
        )
    else:
        show_shared_buildings = False

    return {
        'exclude': exclude,
        'order_by': order_by,
        'sort_reverse': sort_reverse,
        'page': page,
        'number_per_page': number_per_page,
        'show_shared_buildings': show_shared_buildings,
        'q': q,
        'other_search_params': other_search_params,
        'project_id': body.get('project_id')
    }
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/search.py/parse_body/swapped operands of `in`