def paasta_log_line_passes_filter(line, levels, service, components, clusters):
    """Given a (JSON-formatted) log line, return True if the line should be
    displayed given the provided levels, components, and clusters; return False
    otherwise.
    """
    try:
        parsed_line = json.loads(line)
    except __HOLE__:
        log.debug('Trouble parsing line as json. Skipping. Line: %r' % line)
        return False
    return (
        parsed_line.get('level') in levels and
        parsed_line.get('component') in components and (
            parsed_line.get('cluster') in clusters or
            parsed_line.get('cluster') == ANY_CLUSTER
        )
    )
dataset/ETHPy150Open Yelp/paasta/paasta_tools/cli/cmds/logs.py/paasta_log_line_passes_filter