<commit_before>#!/usr/bin/python
"""\
Check for missing conference data, sorted by person responsible.
"""
import codecs
import optparse
import os
import re
import sys

import yaml

from validate import (
    _get,
    error,
    integrity_check,
    load_data,
    usage,
    )

# Ugly hack: only ever write utf-8 to stdout, especially if it is a pipe with no encoding set.
# Better solution: port to python3.
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)

class Options(optparse.OptionParser):
    
    def __init__(self):
        global __doc__
        optparse.OptionParser.__init__(
            self, usage="%prog [options]",
            description=__doc__)
        self.add_option(
            '-d', '--sitedir', action='store', default=os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
            help=("Site root directory."))
        self.add_option(
            '-i', '--person-id', action='store', default=None,
            help=("Nag person with matching id (regex, caseless)."))
        self.add_option(
            '-n', '--name', action='store', default=None,
            help=("Nag person with matching name (regex, caseless)."))
        self.add_option(
            '-t', '--test', action='store', default='all',
            help=("Comma separated list of tests to run (default: all), or prepend a - to skip that test."))
        self.add_option(
            '-l', '--list-tests', action='store_true', default=False,
            help=("List available tests."))
<commit_msg>Remove utf-8 conversion on stdout.<commit_after>#!/usr/bin/python
"""\
Check for missing conference data, sorted by person responsible.
"""
import codecs
import optparse
import os
import re
import sys

import yaml

from validate import (
    _get,
    error,
    integrity_check,
    load_data,
    usage,
    )

# Ugly hack: only ever write utf-8 to stdout, especially if it is a pipe with no encoding set.
# Uncomment this if you get unicode errors on print.
# Better solution: port to python3.
#sys.stdout = codecs.getwriter('utf-8')(sys.stdout)

class Options(optparse.OptionParser):
    
    def __init__(self):
        global __doc__
        optparse.OptionParser.__init__(
            self, usage="%prog [options]",
            description=__doc__)
        self.add_option(
            '-d', '--sitedir', action='store', default=os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
            help=("Site root directory."))
        self.add_option(
            '-i', '--person-id', action='store', default=None,
            help=("Nag person with matching id (regex, caseless)."))
        self.add_option(
            '-n', '--name', action='store', default=None,
            help=("Nag person with matching name (regex, caseless)."))
        self.add_option(
            '-t', '--test', action='store', default='all',
            help=("Comma separated list of tests to run (default: all), or prepend a - to skip that test."))
        self.add_option(
            '-l', '--list-tests', action='store_true', default=False,
            help=("List available tests."))

{'fraction_non_alphanumeric': 0.13749595600129408, 'fraction_numerical': 0.002264639275315432, 'mean_word_length': 2.5953488372093023, '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': '4288349', 'n_tokens_mistral': 911, 'n_tokens_neox': 905, 'n_words': 267}