<commit_before># -*- coding: utf-8 -*-


try:
    import winsound

    def connect_plugin(sound_file):
        winsound.PlaySound(sound_file, winsound.SND_FILENAME)
except ImportError:
    import os
    import subprocess

    play_cmd = {}

    def connect_plugin(sound_file):
        global play_cmd

        ext = os.path.splitext(sound_file)[-1]
        try:
            subprocess.call([play_cmd[ext], sound_file])
            return
        except (KeyError, AttributeError):
            pass

        programs = ['gst123']
        if ext == '.wav':
            programs.append('aplay')
        elif ext == '.mp3':
            programs += ['mpg123', 'mpg321', 'mpg321-mpg123']
        for cmd in programs:
            try:
                subprocess.call([cmd, sound_file])
            except OSError:
                pass  # log here!
            else:
                play_cmd[ext] = cmd
                break
<commit_msg>gst-play-1.0 is another player program which bundled with gstreamer 1.0<commit_after># -*- coding: utf-8 -*-


try:
    import winsound

    def connect_plugin(sound_file):
        winsound.PlaySound(sound_file, winsound.SND_FILENAME)
except ImportError:
    import os
    import subprocess

    play_cmd = {}

    def connect_plugin(sound_file):
        global play_cmd

        ext = os.path.splitext(sound_file)[-1]
        try:
            subprocess.call([play_cmd[ext], sound_file])
            return
        except (KeyError, AttributeError):
            pass

        programs = ['gst123', 'gst-play-1.0']
        if ext == '.wav':
            programs.append('aplay')
        elif ext == '.mp3':
            programs += ['mpg123', 'mpg321', 'mpg321-mpg123']
        for cmd in programs:
            try:
                subprocess.call([cmd, sound_file])
            except OSError:
                pass  # log here!
            else:
                play_cmd[ext] = cmd
                break

{'fraction_non_alphanumeric': 0.10766045548654245, 'fraction_numerical': 0.021739130434782608, 'mean_word_length': 1.6847222222222222, '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': '5874664', 'n_tokens_mistral': 611, 'n_tokens_neox': 572, 'n_words': 130}