<commit_before>#!/usr/bin/env python3
"""
yes, this is python 3 ONLY project
"""

from __future__ import print_function

import sys

# let's be so gentle and print the error message even on python 2

if sys.version_info.major <= 2:
    error_message = """\
It looks like you are running sen with python 2. I'm sorry but sen is a python 3 only project.
Please see installation steps at official project page:

https://github.com/TomasTomecek/sen"""
    print(error_message, file=sys.stderr)
    sys.exit(2)

import argparse
import logging

from sen import set_logging
from sen.exceptions import TerminateApplication
from sen.tui.init import Application
from sen.util import get_log_file_path, log_last_traceback

logger = logging.getLogger("sen")


def main():
    parser = argparse.ArgumentParser(
        description="Terminal User Interface for Docker Engine"
    )
    exclusive_group = parser.add_mutually_exclusive_group()
    exclusive_group.add_argument("--debug", action="store_true", default=None)

    args = parser.parse_args()

    if args.debug:
        set_logging(level=logging.DEBUG, path=get_log_file_path())
    else:
        set_logging(level=logging.INFO, path=get_log_file_path())

    logger.info("application started")

    try:
        ui = Application()
    except TerminateApplication as ex:
        print("Error: {0}".format(str(ex)), file=sys.stderr)
        return 1

    try:
        ui.run()
    except KeyboardInterrupt:
        print("Quitting on user request.")
        return 1
    # except AssertionError as ex:
        # if ex.args[0] == "rows, render mismatch":
        #     logger.error("race condition happened")
        #     # restart the ui
        #     # # continue
    #    return 2
    except Exception as ex:  # pylint: disable=broad-except
        log_last_traceback()
        if args.debug:
            raise
        else:<commit_msg>rows render race: remove old unused code<commit_after>#!/usr/bin/env python3
"""
yes, this is python 3 ONLY project
"""

from __future__ import print_function

import sys

# let's be so gentle and print the error message even on python 2

if sys.version_info.major <= 2:
    error_message = """\
It looks like you are running sen with python 2. I'm sorry but sen is a python 3 only project.
Please see installation steps at official project page:

https://github.com/TomasTomecek/sen"""
    print(error_message, file=sys.stderr)
    sys.exit(2)

import argparse
import logging

from sen import set_logging
from sen.exceptions import TerminateApplication
from sen.tui.init import Application
from sen.util import get_log_file_path, log_last_traceback

logger = logging.getLogger("sen")


def main():
    parser = argparse.ArgumentParser(
        description="Terminal User Interface for Docker Engine"
    )
    exclusive_group = parser.add_mutually_exclusive_group()
    exclusive_group.add_argument("--debug", action="store_true", default=None)

    args = parser.parse_args()

    if args.debug:
        set_logging(level=logging.DEBUG, path=get_log_file_path())
    else:
        set_logging(level=logging.INFO, path=get_log_file_path())

    logger.info("application started")

    try:
        ui = Application()
    except TerminateApplication as ex:
        print("Error: {0}".format(str(ex)), file=sys.stderr)
        return 1

    try:
        ui.run()
    except KeyboardInterrupt:
        print("Quitting on user request.")
        return 1
    except Exception as ex:  # pylint: disable=broad-except
        log_last_traceback()
        if args.debug:
            raise
        else:
{'fraction_non_alphanumeric': 0.09301675977653631, 'fraction_numerical': 0.006145251396648044, 'mean_word_length': 3.183411214953271, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3972428', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1039, 'n_words': 315}