def get_list_params(req):
    _filter = {
        'virtualGuests': {
            'createDate': {
                'operation': 'orderBy',
                'options': [{'name': 'sort', 'value': ['ASC']}],
            }
        }
    }

    if req.get_param('marker') is not None:
        _filter['virtualGuests']['id'] = {
            'operation': '> %s' % req.get_param('marker')
        }

    if req.get_param('image') is not None:
        # TODO(kmcdonald): filter on image in URL format
        pass

    if req.get_param('flavor') is not None:
        # TODO(kmcdonald): filter on flavor in URL format
        pass

    if req.get_param('status') is not None:
        # TODO(kmcdonald): filter on status
        pass

    if req.get_param('changes-since') is not None:
        # TODO(kmcdonald): filter on changes-since
        pass

    if req.get_param('ip') is not None:
        _filter['virtualGuests']['primaryIpAddress'] = {
            'operation': req.get_param('ip')
        }

    if req.get_param('ip6') is not None:
        # TODO(kmcdonald): filter on ipv6 address
        pass

    name = req.get_param('name') or req.get_param('instance_name')
    if name is not None:
        _filter['virtualGuests']['hostname'] = {'operation': name % '~ %s'}

    limit = None
    if req.get_param('limit') is not None:
        try:
            limit = int(req.get_param('limit'))
        except ValueError:
            pass

    return {
        'limit': limit,
        'filter': _filter,
        'mask': get_virtual_guest_mask(),
    }
dataset/ETHPy150Open softlayer/jumpgate/jumpgate/compute/drivers/sl/servers.py/get_list_params/swapped operands of `%`