def METHOD_NAME(path, langs=None):
    data = read_jsonl(path)
    if langs is not None:
        data = [sample for sample in data if sample.get('language') in langs]
    lang2count = collections.defaultdict(int)
    for sample in data:
        lang2count[sample.get('language')] += 1
    if langs:
        assert set(lang2count.keys()) == set(langs)
    nlangs = len(lang2count)
    assert nlangs > 0
    lens = list(lang2count.values())
    assert all([lens[0] == length for length in lens])
    print(f'Loaded {lens[0]} samples in {nlangs} languages from {path}', file=sys.stderr)
    return data