<commit_before>#!/usr/bin/env python3

import getopt
import sys

import player
from logger import *


def usage():
    print("clientPlayer -t number [-v number]")
    print("-t track number")
    print("-v volume")
    print("-d set debug mode")


def main():
    logger = logging.getLogger()

    try:
        opts, args = getopt.gnu_getopt(sys.argv, "t:dv")
    except getopt.GetoptError as err:
        print(err)
        usage()
        sys.exit(1)

    track = 0
    velocity = 40

    for o, a in opts:
        if o == "-t":
            track = [int(x) for x in a.split(",")]
        elif o == "-v":
            velocity = int(a)
        elif o == "-d":
            logger.setLevel(logging.DEBUG)
            logger.debug("Starting debug mode")
        else:
            logger.error("Unknown option {0}", o)

    logger.info("Playing tracks: " + ",".join(map(str, track)))

    # Start playing
    sock_player = player.SocketPlayer(track=track, velocity=velocity)
    sock_player.run()


if __name__ == "__main__":
    try:
        main()
    except KeyboardInterrupt:
        logging.getLogger().info("Shutting down, Thanks for the ride!")<commit_msg>Fix bug when no parameter is passed<commit_after>#!/usr/bin/env python3

import getopt
import sys

import player
from logger import *


def usage():
    print("clientPlayer -t number [-v number]")
    print("-t track number")
    print("-v volume")
    print("-d set debug mode")


def main():
    logger = logging.getLogger()

    try:
        opts, args = getopt.gnu_getopt(sys.argv, "t:dv")
    except getopt.GetoptError as err:
        print(err)
        usage()
        sys.exit(1)

    track = [0]
    velocity = 40

    for o, a in opts:
        if o == "-t":
            track = [int(x) for x in a.split(",")]
        elif o == "-v":
            velocity = int(a)
        elif o == "-d":
            logger.setLevel(logging.DEBUG)
            logger.debug("Starting debug mode")
        else:
            logger.error("Unknown option {0}", o)

    logger.info("Playing tracks: " + ",".join(map(str, track)))

    # Start playing
    sock_player = player.SocketPlayer(track=track, velocity=velocity)
    sock_player.run()


if __name__ == "__main__":
    try:
        main()
    except KeyboardInterrupt:
        logging.getLogger().info("Shutting down, Thanks for the ride!")
{'fraction_non_alphanumeric': 0.13919726729291204, 'fraction_numerical': 0.005123825789923143, 'mean_word_length': 2.2317241379310344, 'pattern_counts': {'":': 8, '<': 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': '192471', 'n_tokens_mistral': 746, 'n_tokens_neox': 723, 'n_words': 207}