def findall(lst, key, value):
return [item for item in lst if item[key.lower()] in value]<EOL>
Find all items in lst where key matches value.
For example find all ``LAYER`` s in a ``MAP`` where ``GROUP`` equals ``VALUE``

Parameters
----------

list: list
    A list of composite dictionaries e.g. ``layers``, ``classes``
key: string
    The key name to search each dictionary in the list
key: value
    The value to search for

Returns
-------

list
    A Python list containing the matching composite dictionaries

Example
-------

To find all ``LAYER`` s with ``GROUP`` set to ``test``::

    s = '''
    MAP
        LAYER
            NAME "Layer1"
            TYPE POLYGON
            GROUP "test"
        END
        LAYER
            NAME "Layer2"
            TYPE POLYGON
            GROUP "test1"
        END
        LAYER
            NAME "Layer3"
            TYPE POLYGON
            GROUP "test2"
        END
        LAYER
            NAME "Layer4"
            TYPE POLYGON
            GROUP "test"
        END
    END
    '''

    d = mappyfile.loads(s)
    layers = mappyfile.findall(d["layers"], "group", "test")
    assert len(layers) == 2