<commit_before>#!/usr/bin/python

import unittest
import sys
import getopt

all_modules=[ "jid", "stream_reader", "xmppserializer", "stanza",
            "message", "presence", "iq", "stanzaprocessor",
            "streambase", 
             "cache", 
#          "vcard", "disco", "dataforms", "interface"
                ]

def suite(modules=None):
     if not modules:
        modules=all_modules
     suite = unittest.TestSuite()
     for mname in modules:
        mod=__import__(mname)
        suite.addTest(mod.suite())
     return suite

def usage():
    print "Usage:"
    print "  %s [-v <verbosity>] " % (sys.argv[0],)
    print "  %s -h"

def main(args=None):
    verbosity=1
    if args:
        try:
            optlist, modules = getopt.getopt(args, 'v:h')
        except getopt.GetoptError:
            usage()
            sys.exit(2)
        for o,v in optlist:
            if o=='-v':
                verbosity=int(v)
            elif o=='-h':
                usage()
                sys.exit(0)
    else:
        modules=None

    unittest.TextTestRunner(verbosity=verbosity).run(suite())

if __name__ == '__main__':
    main(sys.argv[1:])

# vi: sts=4 et sw=4<commit_msg>verbosity level 3 to tests/all.py<commit_after>#!/usr/bin/python

import unittest
import sys
import getopt
import logging

all_modules=[ "jid", "stream_reader", "xmppserializer", "stanza",
            "message", "presence", "iq", "stanzaprocessor",
            "streambase", 
             "cache", 
#          "vcard", "disco", "dataforms", "interface"
                ]

def suite(modules=None):
     if not modules:
        modules=all_modules
     suite = unittest.TestSuite()
     for mname in modules:
        mod=__import__(mname)
        suite.addTest(mod.suite())
     return suite

def usage():
    print "Usage:"
    print "  %s [-v <verbosity>] " % (sys.argv[0],)
    print "  %s -h"

def main(args=None):
    verbosity=1
    if args:
        try:
            optlist, modules = getopt.getopt(args, 'v:h')
        except getopt.GetoptError:
            usage()
            sys.exit(2)
        for o,v in optlist:
            if o=='-v':
                verbosity=int(v)
            elif o=='-h':
                usage()
                sys.exit(0)
    else:
        modules=None
    logger = logging.getLogger()
    logger.addHandler(logging.StreamHandler())
    if verbosity > 2:
        logger.setLevel(logging.DEBUG)
    else:
        logger.setLevel(logging.ERROR)
    unittest.TextTestRunner(verbosity=verbosity).run(suite())

if __name__ == '__main__':
    main(sys.argv[1:])

# vi: sts=4 et sw=4
{'fraction_non_alphanumeric': 0.13873943120676402, 'fraction_numerical': 0.006149116064565719, 'mean_word_length': 2.0127314814814814, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '1591337', 'n_tokens_mistral': 873, 'n_tokens_neox': 853, 'n_words': 186}