<commit_before># usage: exec [host] command:"[command]"
#
# Check success:
#  - sudo ethtool -k [device_name]
#
# Examples:
#  - sudo ethtool -K enp4s0 tso off ufo off gso off gro off lro off
#  - exec-applet 105-offloading alpha command:"tso off ufo off gso off gro off
#    lro off"
#
# Hints:
#  - "Cannot change [...]" messages probably mean that the value can not be
#    changed (is fixed)


def print_usage(x):

    x.p.msg("\n usage:\n", False)
    x.p.msg(" - exec 105-offloading [host] command:\"[command]\"\n", False)
    x.p.msg("\n check success:\n", False)
    x.p.msg(" - ethtool -k [interface]\n", False)
    x.p.msg("\nexample:\n", False)
    x.p.msg(" - exec-applet 105-offloading alpha command:"
            "\"tso off ufo off gso off gro off lro off\"\n",
            False)

    return False


def set_offloading(x, conf, dic):

    device_list = conf.get_all_test_iface_names(dic["host"])
    for device in device_list:
        cmd = "ethtool -K {} {}".format(device, dic["cmd"])
        _, _, exit_code = x.ssh.exec(dic["ip_control"], dic["user"], cmd)
        if exit_code != 0:
            x.p.err("error: offloading could not be set for host {} device {}\n"
                    .format(dic["host"], device))
            x.p.err("failed cmd: \"{}\"".format(cmd))
            return False
<commit_msg>fixing offloading problems due to absolutely incosisten exit codes on part successes<commit_after># usage: exec [host] command:"[command]"
#
# Check success:
#  - sudo ethtool -k [device_name]
#
# Examples:
#  - sudo ethtool -K enp4s0 tso off ufo off gso off gro off lro off
#  - exec-applet 105-offloading alpha command:"tso off ufo off gso off gro off
#    lro off"
#
# Hints:
#  - "Cannot change [...]" messages probably mean that the value can not be
#    changed (is fixed)


def print_usage(x):

    x.p.msg("\n usage:\n", False)
    x.p.msg(" - exec 105-offloading [host] command:\"[command]\"\n", False)
    x.p.msg("\n check success:\n", False)
    x.p.msg(" - ethtool -k [interface]\n", False)
    x.p.msg("\nexample:\n", False)
    x.p.msg(" - exec-applet 105-offloading alpha command:"
            "\"tso off ufo off gso off gro off lro off\"\n",
            False)

    return False


def set_offloading(x, conf, dic):

    device_list = conf.get_all_test_iface_names(dic["host"])
    for device in device_list:
        cmd = "ethtool -K {} {}".format(device, dic["cmd"])
        # unfortunately, error handling does not work, since ethtool sometimes
        # even exits with code 1 on success
        _, _, exit_code = x.ssh.exec(dic["ip_control"], dic["user"], cmd)
        #if exit_code != 0:
        #    x.p.err("error: offloading could not be set for host {} device {}\n"
        #            .format(dic["host"], device))
        #    x.p.err("failed cmd: \"{}\"\n".format(cmd))
        #    return False

{'fraction_non_alphanumeric': 0.15573482988425114, 'fraction_numerical': 0.008768853034023149, 'mean_word_length': 2.5784190715181934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '223656', 'n_tokens_mistral': 1020, 'n_tokens_neox': 973, 'n_words': 295}