count_events(text, kind) that parses each non-empty line separately and counts objects whose 'event' equals kind, skipping lines that fail to parse.count_events(text_with_three_jsonl_lines, "click") # lines: click, view, click
2
Each line is its own document.
text.splitlines() then loads per line.
A try/except inside the loop.