<commit_before>from pydoctor import model, html, astbuilder, liveobjectchecker
import sys, os

def error(msg, *args):
    if args:
        msg = msg%args
    print >> sys.stderr, msg
    sys.exit(1)

def findClassFromDottedName(dottedname, optionname):
    # watch out, print a message and SystemExits on error!
    if '.' not in dottedname:
        error("%stakes a dotted name", optionname)
    parts = dottedname.rsplit('.', 1)
    try:
        mod = __import__(parts[0], globals(), locals(), parts[1])
    except ImportError:
        error("could not import module %s", parts[0])
    try:
        return getattr(mod, parts[1])
    except AttributeError:
        error("did not find %s in module %s", parts[1], parts[0])

def getparser():
    from optparse import OptionParser
    parser = OptionParser()
    parser.add_option('-c', '--config', dest='configfile',
                      help="Use config from this file (any command line"
                           "options override settings from the file).")
    parser.add_option('-p', '--input-pickle', dest='inputpickle',
                      help="Load the system from this pickle file (default: "
                      "none, a blank system is created).")
    parser.add_option('-o', '--output-pickle', dest='outputpickle',
                      help="Save the system to this pickle file (default: "
                      "none, the system is not saved by default).")
    parser.add_option('--extra-system',
                      action='append', dest='moresystems', metavar='SYS:URLPREFIX',
                      default=[],
                      help='Experimental.')
    parser.add_option('--system-class', dest='systemclass',
                      help="a dotted name of the class to use to make a system")
    parser.add_option('--builder-class', dest='builderclass',
                      help="a dotted name of the class to use")
    parser.add_option('--project-name', dest='projectname',
                      help="the project name (appears on index.html)")
    parser.add_option('--testing', dest='testing', action='store_true',
                      help="don't complain if the run doesn't have any effects")
    parser.add_option('--target-state', dest='targetstate',
                      default='finalized',
                      choices=model.states,
                      help="the state to move the system to (default: %default).")
    parser.add_option('--make-html',
                      action='store_true', dest='makehtml',
                      help="")
    parser.add_option('--add-package',
                      action='append', dest='packages', metavar='PACKAGEDIR',
                      default=[],
                      help='Add a package to the system.  Can be repeated '
                           'to add more than one package.')
    parser.add_option('--prepend-package',
                      action='store', dest='prependedpackage',
                      help='')
    parser.add_option('--no-find-import-star',
                      action='store_false', dest='findimportstar',
                      default=True,
                      help="Don't preprocess the modules to resolve import *s."
                           " It's a significant speed saving if you don't need"
                           " it.")
    parser.add_option('--resolve-aliases',
                      action='store_true', dest='resolvealiases',
                      default=True,
                      help="experimental")
    parser.add_option('--abbreviate-specialcase',
                      action='append', dest='abbrevmapping',
                      default=[],
                      help="ask dreid")
    parser.add_option('--html-subject', dest='htmlsubjects',
                      action='append',
                      help="fullName of object to generate API docs for"
                      " (default: everything).")
    parser.add_option('--html-summary-pages', dest='htmlsummarypages',
                      action='store_true',
                      default=False,
                      help="Only generate the summary pages.")
    parser.add_option('--html-write-function-pages', dest='htmlfunctionpages',
                      default=False,
                      action='store_true',
                      help="Make individual HTML files for every function and "
                      "method. They're not linked to in any pydoctor-"
                      "generated HTML, but they can be useful for third-party "
                      "linking.")
    parser.add_option('--html-output', dest='htmloutput',
                      default='apidocs',
                      help="Directory to save HTML files to "
                           "(default 'apidocs')")<commit_msg>that wasn't meant to be True<commit_after>from pydoctor import model, html, astbuilder, liveobjectchecker
import sys, os

def error(msg, *args):
    if args:
        msg = msg%args
    print >> sys.stderr, msg
    sys.exit(1)

def findClassFromDottedName(dottedname, optionname):
    # watch out, print a message and SystemExits on error!
    if '.' not in dottedname:
        error("%stakes a dotted name", optionname)
    parts = dottedname.rsplit('.', 1)
    try:
        mod = __import__(parts[0], globals(), locals(), parts[1])
    except ImportError:
        error("could not import module %s", parts[0])
    try:
        return getattr(mod, parts[1])
    except AttributeError:
        error("did not find %s in module %s", parts[1], parts[0])

def getparser():
    from optparse import OptionParser
    parser = OptionParser()
    parser.add_option('-c', '--config', dest='configfile',
                      help="Use config from this file (any command line"
                           "options override settings from the file).")
    parser.add_option('-p', '--input-pickle', dest='inputpickle',
                      help="Load the system from this pickle file (default: "
                      "none, a blank system is created).")
    parser.add_option('-o', '--output-pickle', dest='outputpickle',
                      help="Save the system to this pickle file (default: "
                      "none, the system is not saved by default).")
    parser.add_option('--extra-system',
                      action='append', dest='moresystems', metavar='SYS:URLPREFIX',
                      default=[],
                      help='Experimental.')
    parser.add_option('--system-class', dest='systemclass',
                      help="a dotted name of the class to use to make a system")
    parser.add_option('--builder-class', dest='builderclass',
                      help="a dotted name of the class to use")
    parser.add_option('--project-name', dest='projectname',
                      help="the project name (appears on index.html)")
    parser.add_option('--testing', dest='testing', action='store_true',
                      help="don't complain if the run doesn't have any effects")
    parser.add_option('--target-state', dest='targetstate',
                      default='finalized',
                      choices=model.states,
                      help="the state to move the system to (default: %default).")
    parser.add_option('--make-html',
                      action='store_true', dest='makehtml',
                      help="")
    parser.add_option('--add-package',
                      action='append', dest='packages', metavar='PACKAGEDIR',
                      default=[],
                      help='Add a package to the system.  Can be repeated '
                           'to add more than one package.')
    parser.add_option('--prepend-package',
                      action='store', dest='prependedpackage',
                      help='')
    parser.add_option('--no-find-import-star',
                      action='store_false', dest='findimportstar',
                      default=True,
                      help="Don't preprocess the modules to resolve import *s."
                           " It's a significant speed saving if you don't need"
                           " it.")
    parser.add_option('--resolve-aliases',
                      action='store_true', dest='resolvealiases',
                      default=False,
                      help="experimental")
    parser.add_option('--abbreviate-specialcase',
                      action='append', dest='abbrevmapping',
                      default=[],
                      help="ask dreid")
    parser.add_option('--html-subject', dest='htmlsubjects',
                      action='append',
                      help="fullName of object to generate API docs for"
                      " (default: everything).")
    parser.add_option('--html-summary-pages', dest='htmlsummarypages',
                      action='store_true',
                      default=False,
                      help="Only generate the summary pages.")
    parser.add_option('--html-write-function-pages', dest='htmlfunctionpages',
                      default=False,
                      action='store_true',
                      help="Make individual HTML files for every function and "
                      "method. They're not linked to in any pydoctor-"
                      "generated HTML, but they can be useful for third-party "
                      "linking.")
    parser.add_option('--html-output', dest='htmloutput',
                      default='apidocs',
                      help="Directory to save HTML files to "
                           "(default 'apidocs')")
{'fraction_non_alphanumeric': 0.11918238993710692, 'fraction_numerical': 0.0016771488469601676, 'mean_word_length': 1.733810888252149, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6770438', 'n_tokens_mistral': 2432, 'n_tokens_neox': 2286, 'n_words': 648}