<commit_before>f(NodeVersions).
NodeVersions = fun () ->
                       F = fun () ->
                                   {node(), logplex_app:config(git_branch),
                                    os:getenv("INSTANCE_NAME")}
                           end,
                       {Good, _} = rpc:multicall(erlang, apply, [F, [] ]),
                       lists:keysort(2, Good)
               end.

f(NodesAt).
NodesAt = fun (Vsn) ->
                  [ N || {N, V, _} <- NodeVersions(), V =:= Vsn ]
          end.

f(RollingUpgrade).
RollingUpgrade = fun (Nodes) ->
  lists:foldl(fun (N, {good, Upgraded}) -><commit_msg>Fix rolling_upgrade shell code to be multi version<commit_after>f(NodeVersions).
NodeVersions = fun () ->
                       lists:keysort(3,
                           [ {N,
                              element(2, rpc:call(N, application, get_env, [logplex, git_branch])),
                              rpc:call(N, os, getenv, ["INSTANCE_NAME"])}
                             || N <- erlang:nodes() ])
               end.

f(NodesAt).
NodesAt = fun (Vsn) ->
                  [ N || {N, V, _} <- NodeVersions(), V =:= Vsn ]
          end.


f(RollingUpgrade).
RollingUpgrade = fun (Nodes) ->
  lists:foldl(fun (N, {good, Upgraded}) ->
{'fraction_non_alphanumeric': 0.14803149606299212, 'fraction_numerical': 0.002362204724409449, 'mean_word_length': 1.3537037037037036, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, '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': '1540575', 'n_tokens_mistral': 399, 'n_tokens_neox': 384, 'n_words': 79}