<commit_before>import threading

import livestreamer


class StreamsThread(threading.Thread):
    def __init__(self, url):
        threading.Thread.__init__(self)
        self.url = url
        self.done = False
        self.error = None
        self.streams = None

    def run(self):
        try:
            streams = livestreamer.streams(self.url)
            self.streams = streams
        except livestreamer.PluginError as plugin_error:
            self.error = plugin_error
        except livestreamer.NoPluginError as no_plugin_error:
            self.error = no_plugin_error

        self.done = True


class DownloadThread(threading.Thread):
    def __init__(self, stream, output_file):
        threading.Thread.__init__(self)
        self.stream = stream
        self.output_file = output_file
        self.total_size = 0
        self._pause = threading.Event()
        self._resume = threading.Event()
        self._cancel = threading.Event()

    def cancel(self):
        if self._pause.is_set():
            self._resume.set()

        self._cancel.set()

    def pause(self):<commit_msg>Use separate attributes for exceptions<commit_after>import threading

import livestreamer


class StreamsThread(threading.Thread):
    def __init__(self, url):
        threading.Thread.__init__(self)
        self.url = url
        self.done = False
        self.plugin_error = None
        self.no_plugin_error = None
        self.streams = None

    def run(self):
        try:
            streams = livestreamer.streams(self.url)
            self.streams = streams
        except livestreamer.PluginError as plugin_error:
            self.plugin_error = plugin_error
        except livestreamer.NoPluginError as no_plugin_error:
            self.no_plugin_error = no_plugin_error

        self.done = True


class DownloadThread(threading.Thread):
    def __init__(self, stream, output_file):
        threading.Thread.__init__(self)
        self.stream = stream
        self.output_file = output_file
        self.total_size = 0
        self._pause = threading.Event()
        self._resume = threading.Event()
        self._cancel = threading.Event()

    def cancel(self):
        if self._pause.is_set():
            self._resume.set()

        self._cancel.set()

    def pause(self):
{'fraction_non_alphanumeric': 0.08547754034016572, 'fraction_numerical': 0.0008722197993894462, 'mean_word_length': 2.2264416315049225, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5079551', 'n_tokens_mistral': 664, 'n_tokens_neox': 653, 'n_words': 137}