<commit_before>import urllib


class Sound(object):
    def __init__(self, url, channel):
        import pygame
        self._channel = pygame.mixer.Channel(channel)
        soundfile = urllib.urlretrieve(url)[0]
        self._sound = pygame.mixer.Sound(soundfile)
        self._paused = False

    def play(self):
        if self._paused:
            self._paused = False
            self._channel.unpause()
        else:
            self._channel.play(self._sound)

    def pause(self):
        self._channel.pause()
        self._paused = True

    def rewind(self):
        self._channel.stop()

    def set_volume(self, volume):
        self._channel.set_volume(volume)

_initialized = False
_next_channel = 0


def sound_init():
    global _initialized
    import pygame
    pygame.mixer.init()
    _initialized = True


def load_sound(URL):
    global _next_channel
    if not _initialized:
        sound_init()

    _next_channel += 1<commit_msg>Increases the number of channels to 32 so that up to 32 samples can be played<commit_after>import urllib


class Sound(object):
    def __init__(self, url, channel):
        import pygame
        self._channel = pygame.mixer.Channel(channel)
        soundfile = urllib.urlretrieve(url)[0]
        self._sound = pygame.mixer.Sound(soundfile)
        self._paused = False

    def play(self):
        if self._paused:
            self._paused = False
            self._channel.unpause()
        else:
            self._channel.play(self._sound)

    def pause(self):
        self._channel.pause()
        self._paused = True

    def rewind(self):
        self._channel.stop()

    def set_volume(self, volume):
        self._channel.set_volume(volume)

MAX_CHANNELS = 32
_initialized = False
_next_channel = 0


def sound_init():
    global _initialized
    import pygame
    pygame.mixer.init()
    pygame.mixer.set_num_channels(MAX_CHANNELS)
    _initialized = True


def load_sound(URL):
    global _next_channel
    if not _initialized:
        sound_init()

    _next_channel += 1
{'fraction_non_alphanumeric': 0.09077526987242394, 'fraction_numerical': 0.005888125613346418, 'mean_word_length': 2.3983333333333334, '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': '2089891', 'n_tokens_mistral': 645, 'n_tokens_neox': 624, 'n_words': 141}