<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

# 
# This is a very simple discuss client which was created to make reading discuss
# meetings less painful. It is sort of ugly and contains globals.
#

from __future__ import division
from __future__ import print_function

import curses, discuss  # discuss always comes with curses

import argparse
import locale
import signal
import sys

# Globals initialization
pos_cur = 0
pos_top = 0
viewed_transaction = None

# Functions

def die(reason = ""):
    try:
        screen.keypad(0)
        curses.nocbreak()
        curses.echo()
        curses.endwin()
    except:
        pass

    if screen != "":
        print(reason, file=sys.stderr)
        sys.exit(1)
    else:
        sys.exit(0)

class ProgressDisplay(object):
    def __init__(self):
        self.last_text = ""
        curses.curs_set(0)
        screen.nodelay(True)

    def display_progress(this, cur, total, left):
        done = total - left
        percent = done / total * 100
        output = "%.02f %% (%i / %i)" % (percent, done, total)

        max_y, max_x = screen.getmaxyx()
        mid_y = max_y // 2
        mid_x = max_x // 2

        screen.erase()
        screen.addstr(mid_y, mid_x - len(output) // 2, output)
        screen.refresh()<commit_msg>Fix a stupid typo.<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

# 
# This is a very simple discuss client which was created to make reading discuss
# meetings less painful. It is sort of ugly and contains globals.
#

from __future__ import division
from __future__ import print_function

import curses, discuss  # discuss always comes with curses

import argparse
import locale
import signal
import sys

# Globals initialization
pos_cur = 0
pos_top = 0
viewed_transaction = None

# Functions

def die(reason = ""):
    try:
        screen.keypad(0)
        curses.nocbreak()
        curses.echo()
        curses.endwin()
    except:
        pass

    if reason != "":
        print(reason, file=sys.stderr)
        sys.exit(1)
    else:
        sys.exit(0)

class ProgressDisplay(object):
    def __init__(self):
        self.last_text = ""
        curses.curs_set(0)
        screen.nodelay(True)

    def display_progress(this, cur, total, left):
        done = total - left
        percent = done / total * 100
        output = "%.02f %% (%i / %i)" % (percent, done, total)

        max_y, max_x = screen.getmaxyx()
        mid_y = max_y // 2
        mid_x = max_x // 2

        screen.erase()
        screen.addstr(mid_y, mid_x - len(output) // 2, output)
        screen.refresh()
{'fraction_non_alphanumeric': 0.10723964382500968, 'fraction_numerical': 0.011614401858304297, 'mean_word_length': 2.3256113256113258, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1381465', 'n_tokens_mistral': 847, 'n_tokens_neox': 814, 'n_words': 240}