<commit_before>#!/usr/bin/env python
# All uniCurses routines to ASCii Effects representation on the terminal are here (or should be)...

"""
Copyright (c) 2016, <NAME>
Description: The power is in the terminal...
License: MIT (see LICENSE.txt file for details)
"""

import time
from subprocess import call
from unicurses import *

#Insights sample counter...
sample_one = 0; sample_two = 0;

#Colors...
def set_colors():
	init_pair(1, COLOR_BLUE, COLOR_BLUE);
	init_pair(2, COLOR_YELLOW, COLOR_YELLOW);
	init_pair(3, COLOR_BLACK, COLOR_WHITE);
	init_pair(4, COLOR_WHITE, COLOR_BLACK);
	init_pair(5, COLOR_GREEN, COLOR_GREEN);
	init_pair(6, COLOR_GREEN, COLOR_BLACK);
	init_pair(7, COLOR_YELLOW, COLOR_BLACK);
	init_pair(8, COLOR_RED, COLOR_BLACK);
	init_pair(9, COLOR_RED, COLOR_RED);
	init_pair(10, COLOR_BLUE, COLOR_BLACK);

#Draw logo...
def draw_logo(window):
	first_square = derwin(window, 3, 6, 1, 1);
	second_square = derwin(window, 3, 6, 1, 8);
	third_square = derwin(window, 3, 6, 4, 1);
	forth_square = derwin(window, 3, 6, 4, 8);
	write_str_color(first_square, 0, 1, "     ", 9, 0);
	write_str_color(first_square, 1, 1, "     ", 9, 0);
	write_str_color(second_square, 0, 1, "     ", 5, 0);
	write_str_color(second_square, 1, 1, "     ", 5, 0);
	write_str_color(third_square, 0, 1, "     ", 1, 0);
	write_str_color(third_square, 1, 1, "     ", 1, 0);
	write_str_color(forth_square, 0, 1, "     ", 2, 0);
	write_str_color(forth_square, 1, 1, "     ", 2, 0);

#Create Windows...
def create_window(x, y, w, z):
        #window = newwin(lines, colunms, startline, startcolunm);
	window = newwin(x, y, w, z);
	#DEBUG
        #box(window);
	return window;

#Draw VM...
def draw_vm(vmc, window, ps, flag):
	if (vmc < 100):
		nr = "%03d" % vmc;
	else:
		nr = vmc;

	if (ps.upper() == "SUCCEEDED"):
		write_str_color(window, 1, 1, nr, 6, 1);
	elif (ps.upper() == "CREATING"):	
		write_str_color(window, 1, 1, nr, 7, 1);
	elif (ps.upper() == "DELETING"):	
		write_str(window, 1, 1, nr);
	#Any other state we do not know about?
	else:
		write_str_color(window, 1, 1, nr, 1, 1);

	#Mark VM Selected by the user...
	if (flag):
		wmove(window, 2, 1); whline(window, "<" , 1);
		wmove(window, 2, 3); whline(window, ">" , 1);
	else:
		box(window);

def do_update_bar(window, sp, flag):
        a = bar = 22; total = 34;
        curstep = bar + sp;

        if (curstep > total): curstep = total;
        if (flag != 1): total = curstep;

        while (a < total):
                write_str_color(window, 1, a, " ", 5, 1);
                a += 1;
        wrefresh(window);
        time.sleep(.2);

def win_animation(panel, nasp, xfinal, yfinal):
	xstart = nasp[0];
	ystart = nasp[1];

	while (xstart != xfinal):
		move_panel (panel, xstart, ystart);
		update_panels();
		doupdate();
		xstart -= 1;
		time.sleep(.003);
	while (ystart != yfinal):
		move_panel (panel, xstart, ystart);
		update_panels();<commit_msg>A test to fix a flick on the screen...<commit_after>#!/usr/bin/env python
# All uniCurses routines to ASCii Effects representation on the terminal are here (or should be)...

"""
Copyright (c) 2016, <NAME>
Description: The power is in the terminal...
License: MIT (see LICENSE.txt file for details)
"""

import time
from subprocess import call
from unicurses import *

#Insights sample counter...
sample_one = 0; sample_two = 0;

#Colors...
def set_colors():
	init_pair(1, COLOR_BLUE, COLOR_BLUE);
	init_pair(2, COLOR_YELLOW, COLOR_YELLOW);
	init_pair(3, COLOR_BLACK, COLOR_WHITE);
	init_pair(4, COLOR_WHITE, COLOR_BLACK);
	init_pair(5, COLOR_GREEN, COLOR_GREEN);
	init_pair(6, COLOR_GREEN, COLOR_BLACK);
	init_pair(7, COLOR_YELLOW, COLOR_BLACK);
	init_pair(8, COLOR_RED, COLOR_BLACK);
	init_pair(9, COLOR_RED, COLOR_RED);
	init_pair(10, COLOR_BLUE, COLOR_BLACK);

#Draw logo...
def draw_logo(window):
	first_square = derwin(window, 3, 6, 1, 1);
	second_square = derwin(window, 3, 6, 1, 8);
	third_square = derwin(window, 3, 6, 4, 1);
	forth_square = derwin(window, 3, 6, 4, 8);
	write_str_color(first_square, 0, 1, "     ", 9, 0);
	write_str_color(first_square, 1, 1, "     ", 9, 0);
	write_str_color(second_square, 0, 1, "     ", 5, 0);
	write_str_color(second_square, 1, 1, "     ", 5, 0);
	write_str_color(third_square, 0, 1, "     ", 1, 0);
	write_str_color(third_square, 1, 1, "     ", 1, 0);
	write_str_color(forth_square, 0, 1, "     ", 2, 0);
	write_str_color(forth_square, 1, 1, "     ", 2, 0);

#Create Windows...
def create_window(x, y, w, z):
        #window = newwin(lines, colunms, startline, startcolunm);
	window = newwin(x, y, w, z);
	#DEBUG
        #box(window);
	return window;

#Draw VM...
def draw_vm(vmc, window, ps, flag):
	if (vmc < 100):
		nr = "%03d" % vmc;
	else:
		nr = vmc;

	if (ps.upper() == "SUCCEEDED"):
		write_str_color(window, 1, 1, nr, 6, 1);
	elif (ps.upper() == "CREATING"):	
		write_str_color(window, 1, 1, nr, 7, 1);
	elif (ps.upper() == "DELETING"):	
		write_str(window, 1, 1, nr);
	#Any other state we do not know about?
	else:
		write_str_color(window, 1, 1, nr, 1, 1);

	#Mark VM Selected by the user...
	if (flag):
		wmove(window, 2, 1); whline(window, "<" , 1);
		wmove(window, 2, 3); whline(window, ">" , 1);
	else:
		box(window);

def do_update_bar(window, sp, flag):
        a = bar = 22; total = 34;
        curstep = bar + sp;

        if (curstep > total): curstep = total;
        if (flag != 1): total = curstep;

        while (a < total):
                write_str_color(window, 1, a, " ", 5, 1);
                a += 1;
        #wrefresh(window);
	update_panels();
        time.sleep(.2);

def win_animation(panel, nasp, xfinal, yfinal):
	xstart = nasp[0];
	ystart = nasp[1];

	while (xstart != xfinal):
		move_panel (panel, xstart, ystart);
		update_panels();
		doupdate();
		xstart -= 1;
		time.sleep(.003);
	while (ystart != yfinal):
		move_panel (panel, xstart, ystart);
		update_panels();
{'fraction_non_alphanumeric': 0.16296928327645052, 'fraction_numerical': 0.03617747440273038, 'mean_word_length': 3.6222397476340693, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '2314518', 'n_tokens_mistral': 2598, 'n_tokens_neox': 2345, 'n_words': 632}