<commit_before>import threading
import sublime
import sublime_plugin


class HistoryList(list):
    """List type for storing the history - fairly
    inefficient, but useful.
    """

    SIZE = 256
    index = 0

    def append(self, item, update_index=True):
        self.insert(0, item)
        if update_index:
            self.index = 0
        if len(self) > self.SIZE:
            del self[self.SIZE:]

    def current(self):
        if len(self) == 0:
            return None
        return self[self.index]

    def next(self):
        if self.index > 0:
            self.index -= 1

    def previous(self):
        if self.index < len(self) - 1:
            self.index += 1

_LOCK = threading.RLock()
_HISTORY = HistoryList()


class ClipboardHistoryBase(sublime_plugin.TextCommand):

    def update_clipboard(self, content):
        sublime.set_clipboard(content)

    def next(self):
        with _LOCK:
            _HISTORY.next()
            self.update_clipboard(_HISTORY.current())

    def previous(self):
        with _LOCK:
            _HISTORY.previous()
            self.update_clipboard(_HISTORY.current())

    def appendClipboard(self):
        with _LOCK:
            # append the contents of the clipboard to the history if it is unique
            if not self.onCurrent():
                _HISTORY.append(sublime.get_clipboard())<commit_msg>show clipboard as status message<commit_after>import threading
import sublime
import sublime_plugin


class HistoryList(list):
    """List type for storing the history - fairly
    inefficient, but useful.
    """

    SIZE = 256
    index = 0

    def append(self, item, update_index=True):
        self.insert(0, item)
        if update_index:
            self.index = 0
        if len(self) > self.SIZE:
            del self[self.SIZE:]

    def current(self):
        if len(self) == 0:
            return None
        return self[self.index]

    def next(self):
        if self.index > 0:
            self.index -= 1

    def previous(self):
        if self.index < len(self) - 1:
            self.index += 1

_LOCK = threading.RLock()
_HISTORY = HistoryList()


class ClipboardHistoryBase(sublime_plugin.TextCommand):

    def update_clipboard(self, content):
        sublime.status_message("Set Clipboard to " + content)
        sublime.set_clipboard(content)

    def next(self):
        with _LOCK:
            _HISTORY.next()
            self.update_clipboard(_HISTORY.current())

    def previous(self):
        with _LOCK:
            _HISTORY.previous()
            self.update_clipboard(_HISTORY.current())

    def appendClipboard(self):
        with _LOCK:
            # append the contents of the clipboard to the history if it is unique
            if not self.onCurrent():
                _HISTORY.append(sublime.get_clipboard())
{'fraction_non_alphanumeric': 0.09442669506567271, 'fraction_numerical': 0.007809726659566915, 'mean_word_length': 2.096703296703297, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '768089', 'n_tokens_mistral': 875, 'n_tokens_neox': 820, 'n_words': 215}