def line_count(file):
    """Utility function for getting number of lines in a text file."""
    count = 0
    with open(file, encoding="utf-8") as f:
        for _ in f:
            count += 1
    return count