def filter_results(result_list, filter_dictionary):
    """
    Given a dictionary and a list of results (paper dictionaries)
    returns the results which pass the filter
    The items in the filter_dictionary must be a list
    """
    lista = []
    for paper in result_list:
        done = False
        for key, item in filter_dictionary.items():
            if done:
                break
            val = paper[key]
            for keyword in item:
                if isinstance(val, str):
                    if keyword.lower() in val.lower():
                        lista.append(paper)
                        done = True
                        break
                elif isinstance(val, list):
                    if done:
                        break
                    for keyval in val:
                        if keyword.lower() in keyval.lower():
                            lista.append(paper)
                            done = True
                            break
    return lista
