<commit_before>import argparse
import platform
import signal
import sys
import time
import ConfigParser
import os
import imaplib
import imap_connect
import imap_read
import imap_idle
from throttle import throttle
import pipsta

#imaplib.Debug = 4

MONITOR_POLL_PERIOD = 3

def parse_arguments():
    parser = argparse.ArgumentParser(description='Monitors IMAP and prints messages')
    return parser.parse_args()

def signal_handler(sig_int, frame):
    del sig_int, frame
    sys.exit()

@throttle(seconds=5)
def process_mail():
    config = ConfigParser.ConfigParser()
    config.read([os.path.abspath('settings.ini')])

    mailbox = imap_connect.open_connection(config, verbose=True)
    try:
        imap_read.read_folder(mailbox, config.get('email', 'folder'), print_message)
    finally:
        mailbox.logout()

def print_message(date, subject, content):

    txt = '* ' * 40
    txt += '\r\n'
    txt += 'Date: %s' % date
    txt += '\r\n'
    txt += 'Subject: %s' % subject
    txt += '\r\n'
    txt += '-' * 80
    txt += '\r\n'    
    if len(content) == 0: 
        txt += '++ No Potatoes Error ++'
    else:
        txt += content
    txt += '\r\n'
    txt += '* ' * 40

    print txt<commit_msg>Correctly correctly format message for printing<commit_after>import argparse
import platform
import signal
import sys
import time
import ConfigParser
import os
import imaplib
import imap_connect
import imap_read
import imap_idle
from throttle import throttle
import pipsta

#imaplib.Debug = 4

MONITOR_POLL_PERIOD = 3

def parse_arguments():
    parser = argparse.ArgumentParser(description='Monitors IMAP and prints messages')
    return parser.parse_args()

def signal_handler(sig_int, frame):
    del sig_int, frame
    sys.exit()

@throttle(seconds=5)
def process_mail():
    config = ConfigParser.ConfigParser()
    config.read([os.path.abspath('settings.ini')])

    mailbox = imap_connect.open_connection(config, verbose=True)
    try:
        imap_read.read_folder(mailbox, config.get('email', 'folder'), print_message)
    finally:
        mailbox.logout()

def print_message(date, subject, content):

    txt = ''
    txt += '-' * 32
    txt += '\r\n'
    txt += 'Date: %s' % date
    txt += '\r\n'
    txt += 'Subject: %s' % subject
    txt += '\r\n'
    txt += '* ' * 16   
    txt += '\r\n'    
    if len(content) == 0: 
        txt += '++ No Potatoes Error ++'
    else:
        txt += content

    print txt
{'fraction_non_alphanumeric': 0.1257189811010682, 'fraction_numerical': 0.007395234182415777, 'mean_word_length': 3.1910499139414803, 'pattern_counts': {'":': 0, '<': 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': '1823168', 'n_tokens_mistral': 834, 'n_tokens_neox': 801, 'n_words': 211}