# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

from collections import Counter
from itertools import chain


def count_words_in_file(fn):
    with open(fn) as f:
        return Counter(chain.from_iterable(map(str.split,f)))


count_words_in_file('countme.txt')

next(chain.from_iterable(map(str.split, open('countme.txt'))))

StarcoderdataJupyterScriptsDedupFiltered