def filter_parms(**items):
    """
    To get all segment for 'petrol truck'. Valid parameters:
        cat=category
        fuel=fuel
        segment=segment
        eurostd=eurostd
        pollutant=pollutant
        mode=mode

    >>> truck = session.query(emission.models.Category).all()[2]
    >>> fuel = list(truck.fuels())[0]
    >>> filtered_parameters = emission.models.filter(cat=truck, fuel=fuel)
    >>> set(x.segment for x in filtered_parameters)
    """
    parameters = []
    if 'cat' in items:
        parameters = items.get('cat').parameter
    if 'fuel' in items:
        parameters = list(filter(lambda x: x.fuel == items.get('fuel'),
            parameters))
    if 'segment' in items:
        parameters = list(filter(lambda x: x.segment == items.get('segment'
            ), parameters))
    if 'eurostd' in items:
        parameters = list(filter(lambda x: x.eurostd == items.get('eurostd'
            ), parameters))
    if 'pollutant' in items:
        parameters = list(filter(lambda x: x.pollutant == items.get(
            'pollutant'), parameters))
    if 'mode' in items:
        parameters = list(filter(lambda x: x.mode == items.get('mode'),
            parameters))
    return parameters
