<commit_before>"""
Calculate a machine speed score.

@author: <NAME> <<EMAIL>>
"""

if __name__ == "__main__":
    from utexas.tools.calibrate import main

    raise SystemExit(main())

from cargo.log   import get_logger
from cargo.flags import (
    Flag,
    Flags,
    with_flags_parsed,
    )

log          = get_logger(__name__, default_level = "NOTSET")
module_flags = \
    Flags(
        "Script Options",
        Flag(
            "-r",
            "--repeats",
            type    = int,
            default = 4,
            metavar = "INT",
            help    = "run each solver INT times [%default]",
            ),
        Flag(
            "-c",
            "--calibration",
            metavar = "FILE",
            help    = "use calibration configuration FILE [%default]",
            ),
        )

def get_solver(named_solvers, name):
    """
    Build a complete solver.
    """

    from utexas.sat.solvers import (
        SAT_SanitizingSolver,
        SAT_UncompressingSolver,
        )

    return SAT_UncompressingSolver(SAT_SanitizingSolver(named_solvers[name]), name)

def main():
    """
    Application body.
    """

    # get command line arguments
    import utexas.sat.solvers

    from cargo.sql.alchemy import SQL_Engines
    from cargo.flags       import parse_given

    parse_given()

    # set up log output
    from cargo.log import enable_default_logging

    enable_default_logging()

    get_logger("cargo.unix.accounting", level = "DETAIL")

    # build the solvers
    from utexas.sat.solvers import get_named_solvers

    named_solvers = get_named_solvers()

    # build the calibration runs
    import json

    with open(module_flags.given.calibration) as file:
        runs = json.load(file)

    # and execute them<commit_msg>Calibration script shouldn't depend on SA.<commit_after>"""
Calculate a machine speed score.

@author: <NAME> <<EMAIL>>
"""

if __name__ == "__main__":
    from utexas.tools.calibrate import main

    raise SystemExit(main())

from cargo.log   import get_logger
from cargo.flags import (
    Flag,
    Flags,
    with_flags_parsed,
    )

log          = get_logger(__name__, default_level = "NOTSET")
module_flags = \
    Flags(
        "Script Options",
        Flag(
            "-r",
            "--repeats",
            type    = int,
            default = 4,
            metavar = "INT",
            help    = "run each solver INT times [%default]",
            ),
        Flag(
            "-c",
            "--calibration",
            metavar = "FILE",
            help    = "use calibration configuration FILE [%default]",
            ),
        )

def get_solver(named_solvers, name):
    """
    Build a complete solver.
    """

    from utexas.sat.solvers import (
        SAT_SanitizingSolver,
        SAT_UncompressingSolver,
        )

    return SAT_UncompressingSolver(SAT_SanitizingSolver(named_solvers[name]), name)

def main():
    """
    Application body.
    """

    # get command line arguments
    import utexas.sat.solvers

    from cargo.flags       import parse_given

    parse_given()

    # set up log output
    from cargo.log import enable_default_logging

    enable_default_logging()

    get_logger("cargo.unix.accounting", level = "DETAIL")

    # build the solvers
    from utexas.sat.solvers import get_named_solvers

    named_solvers = get_named_solvers()

    # build the calibration runs
    import json

    with open(module_flags.given.calibration) as file:
        runs = json.load(file)

    # and execute them
{'fraction_non_alphanumeric': 0.09787835926449788, 'fraction_numerical': 0.0005657708628005657, 'mean_word_length': 2.109938434476693, 'pattern_counts': {'":': 2, '<': 9, '<?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': '2348255', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1051, 'n_words': 266}