def _filter_by_tag(journal, tags):
    """filter by list of tags. tags='any' allows any entry with some tag"""
    if tags == 'any':
        tag_filter = lambda item: 'Tags' in item
    else:
        tag_filter = lambda item: 'Tags' in item and set(item['Tags']).intersection(set(tags))

    return filter(tag_filter, journal)
dataset/ETHPy150Open nathangrigg/dayone_export/dayone_export/__init__.py/_filter_by_tag/original