def param_getlist(key, params):
    """Search 'params' for 'key' and return a list with its values. If
    'key' did not appear in 'params', return the empty list."""
    result = []
    for k, v in params:
        if key == k:
            result.append(v)
    return result