<commit_before>import datetime
import json
from copy import deepcopy


__version__ = '0.0'


class Color(object):
    """
    A color type. Internally stored as RGB, and does not support transparency.
    """
    def __init__(self, rgb):
        if not isinstance(rgb, tuple):
            rgb = tuple(rgb)
        self.rgb = rgb

    def __eq__(self, other):
        return self.rgb == other.rgb

    @property
    def css(self):
        return 'rgb(%d, %d, %d)' % self.rgb


class Thread(object):
    """
    Represents a single thread, either weft or warp.
    """
    def __init__(self, dir, color=None, shafts=None, treadles=None):
        self.dir = dir
        if color and not isinstance(color, Color):
            color = Color(color)
        self.color = color
        self.shafts = shafts or set()
        assert (dir == 'weft') or (not treadles), \
            "only weft threads can have treadles"
        self.treadles = treadles or set()

    @property
    def connected_shafts(self):<commit_msg>Add an assertion to prevent mixing of liftplan-only and treadle definitions<commit_after>import datetime
import json
from copy import deepcopy


__version__ = '0.0'


class Color(object):
    """
    A color type. Internally stored as RGB, and does not support transparency.
    """
    def __init__(self, rgb):
        if not isinstance(rgb, tuple):
            rgb = tuple(rgb)
        self.rgb = rgb

    def __eq__(self, other):
        return self.rgb == other.rgb

    @property
    def css(self):
        return 'rgb(%d, %d, %d)' % self.rgb


class Thread(object):
    """
    Represents a single thread, either weft or warp.
    """
    def __init__(self, dir, color=None, shafts=None, treadles=None):
        self.dir = dir
        if color and not isinstance(color, Color):
            color = Color(color)
        self.color = color
        assert not (shafts and treadles), \
            "can't have both shafts (liftplan) and treadles specified"
        self.shafts = shafts or set()
        assert (dir == 'weft') or (not treadles), \
            "only weft threads can have treadles"
        self.treadles = treadles or set()

    @property
    def connected_shafts(self):
{'fraction_non_alphanumeric': 0.10559854346836596, 'fraction_numerical': 0.0018206645425580337, 'mean_word_length': 2.345509893455099, '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': '197329', 'n_tokens_mistral': 684, 'n_tokens_neox': 645, 'n_words': 222}