<commit_before>import logging
import random
from enum import Enum

import yaml

LOGGER = logging.getLogger(__name__)


class CompactionStrategy(Enum):
    LEVELED = "LeveledCompactionStrategy"
    SIZE_TIERED = "SizeTieredCompactionStrategy"
    TIME_WINDOW = "TimeWindowCompactionStrategy"
    INCREMENTAL = "IncrementalCompactionStrategy"
    IN_MEMORY = "InMemoryCompactionStrategy"

    @classmethod
    def from_str(cls, output_str):
        try:
            return CompactionStrategy[CompactionStrategy(output_str).name]
        except AttributeError as attr_err:
            err_msg = "Could not recognize compaction strategy value: {} - {}".format(output_str, attr_err)
            raise ValueError(err_msg) from attr_err


def get_compaction_strategy(node, keyspace, table):
    """Get a given table compaction strategy

    Arguments:<commit_msg>fix(compaction.py): Added DateTieredCompactionStrategy to list<commit_after>import logging
import random
from enum import Enum

import yaml

LOGGER = logging.getLogger(__name__)


class CompactionStrategy(Enum):
    LEVELED = "LeveledCompactionStrategy"
    SIZE_TIERED = "SizeTieredCompactionStrategy"
    TIME_WINDOW = "TimeWindowCompactionStrategy"
    INCREMENTAL = "IncrementalCompactionStrategy"
    IN_MEMORY = "InMemoryCompactionStrategy"
    DATE_TIERED = "DateTieredCompactionStrategy"

    @classmethod
    def from_str(cls, output_str):
        try:
            return CompactionStrategy[CompactionStrategy(output_str).name]
        except AttributeError as attr_err:
            err_msg = "Could not recognize compaction strategy value: {} - {}".format(output_str, attr_err)
            raise ValueError(err_msg) from attr_err


def get_compaction_strategy(node, keyspace, table):
    """Get a given table compaction strategy

    Arguments:
{'fraction_non_alphanumeric': 0.0712707182320442, 'fraction_numerical': 0.0, 'mean_word_length': 4.219020172910663, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7283569', 'n_tokens_mistral': 528, 'n_tokens_neox': 511, 'n_words': 123}