<commit_before>#!/usr/bin/env escript
-mode(compile).

-export([stop/2]).

main([TimeoutStr | NodesStr]) ->
    io:format("~p starting~n", [os:timestamp()]),

    {ok, [[Home|_]|_]} = init:get_argument(home),
    ReleaseInfoFile = filename:join(Home, "mz/mzbench/releases/RELEASES"),
    {ok, [[{release, "mzbench", _, _, Applications, _}]]} = file:consult(ReleaseInfoFile),
    {mzbench_utils, _Version, BuildPath} = lists:keyfind(mzbench_utils, 1, Applications),
    MZBenchUtilsInstallPath = filename:join([Home, "mz/mzbench/lib", filename:basename(BuildPath), "ebin"]),
    code:add_path(MZBenchUtilsInstallPath),
    ok = application:load(mzbench_utils),

    Timeout =
        try erlang:list_to_integer(TimeoutStr) of
            TO when TO > 0 -> TO;<commit_msg>Unify code locading code in escripts<commit_after>#!/usr/bin/env escript
-mode(compile).

-export([stop/2]).

add_libs() ->
    BinDir = filename:dirname(escript:script_name()),
    CodePaths = filelib:wildcard(filename:join(BinDir, "../lib/mzbench_utils-*/ebin/")),
    code:add_pathsz(CodePaths).

main([TimeoutStr | NodesStr]) ->
    io:format("~p starting~n", [os:timestamp()]),

    add_libs(),
    ok = application:load(mzbench_utils),

    Timeout =
        try erlang:list_to_integer(TimeoutStr) of
            TO when TO > 0 -> TO;
{'fraction_non_alphanumeric': 0.17099236641221374, 'fraction_numerical': 0.003816793893129771, 'mean_word_length': 4.351020408163265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '4138577', 'n_tokens_mistral': 480, 'n_tokens_neox': 459, 'n_words': 75}