<commit_before>import bisect
import os
import pprint
import random
import re
import subprocess
import time
import uuid

from collections import defaultdict
from distutils.version import LooseVersion
from dtest import Tester, debug, DEFAULT_DIR
from tools import new_node
from cassandra import ConsistencyLevel, WriteTimeout
from cassandra.query import SimpleStatement


# Versions are tuples of (major_ver, minor_ver)
# Used to build upgrade path(s) for tests. Some tests will go from start to finish,
# other tests will focus on single upgrades from UPGRADE_PATH[n] to UPGRADE_PATH[n+1]

TRUNK_VER = (3, 0)
DEFAULT_PATH = [(2, 1), TRUNK_VER]

CUSTOM_PATH = os.environ.get('UPGRADE_PATH', None)
if CUSTOM_PATH:
    # provide a custom path like so: "1_2:2_0:2_1" to test upgrading from 1.2 to 2.0 to 2.1
    UPGRADE_PATH = []
    for _vertup in CUSTOM_PATH.split(':'):
        _major, _minor = _vertup.split('_')
        UPGRADE_PATH.append((int(_major), int(_minor)))
else:
    UPGRADE_PATH = DEFAULT_PATH

LOCAL_MODE = os.environ.get('LOCAL_MODE', '').lower() in ('yes', 'true')
if LOCAL_MODE:
    REPO_LOCATION = os.environ.get('CASSANDRA_DIR')
else:
    REPO_LOCATION = "https://git-wip-us.apache.org/repos/asf/cassandra.git"<commit_msg>Add 2.2 to upgrade path<commit_after>import bisect
import os
import pprint
import random
import re
import subprocess
import time
import uuid

from collections import defaultdict
from distutils.version import LooseVersion
from dtest import Tester, debug, DEFAULT_DIR
from tools import new_node
from cassandra import ConsistencyLevel, WriteTimeout
from cassandra.query import SimpleStatement


# Versions are tuples of (major_ver, minor_ver)
# Used to build upgrade path(s) for tests. Some tests will go from start to finish,
# other tests will focus on single upgrades from UPGRADE_PATH[n] to UPGRADE_PATH[n+1]

TRUNK_VER = (3, 0)
DEFAULT_PATH = [(2, 1), (2, 2), TRUNK_VER]

CUSTOM_PATH = os.environ.get('UPGRADE_PATH', None)
if CUSTOM_PATH:
    # provide a custom path like so: "1_2:2_0:2_1" to test upgrading from 1.2 to 2.0 to 2.1
    UPGRADE_PATH = []
    for _vertup in CUSTOM_PATH.split(':'):
        _major, _minor = _vertup.split('_')
        UPGRADE_PATH.append((int(_major), int(_minor)))
else:
    UPGRADE_PATH = DEFAULT_PATH

LOCAL_MODE = os.environ.get('LOCAL_MODE', '').lower() in ('yes', 'true')
if LOCAL_MODE:
    REPO_LOCATION = os.environ.get('CASSANDRA_DIR')
else:
    REPO_LOCATION = "https://git-wip-us.apache.org/repos/asf/cassandra.git"
{'fraction_non_alphanumeric': 0.10128102481985589, 'fraction_numerical': 0.01521216973578863, 'mean_word_length': 4.731651376146789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7638092', 'n_tokens_mistral': 900, 'n_tokens_neox': 867, 'n_words': 263}