def num_lines_in_file(file_name):
    """ Count the number of lines in a file, return num lines is zero if the file is empty """
    line_idx = -1
    with open(file_name) as file:
        for line_idx, _ in enumerate(file):
            pass
    return line_idx + 1