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

import pytest


puzzle_input = '1113122113'


def parse_number_string(number_string):
    char, *text = str(number_string)    # str just in case
    count = 1
    output = ''
    for new_char in text:
        if new_char == char:
            count += 1
        else:
            output += str(count) + char
            char = new_char
            count = 1
    else:
        # This is needed to ensure final digit is accounted for
        output += str(count) + char
    return output


@pytest.mark.parametrize('start,finish', [
    ('1', '11'),
    ('11', '21'),
    ('21', '1211'),
    ('211', '1221'),
    ('1211', '111221'),<commit_msg>2015-10.py: Expand unnecessary else branch in for loop<commit_after>#!/usr/local/bin/python3

import pytest


puzzle_input = '1113122113'


def parse_number_string(number_string):
    char, *text = str(number_string)    # str just in case
    count = 1
    output = ''
    for new_char in text:
        if new_char == char:
            count += 1
        else:
            output += str(count) + char
            char = new_char
            count = 1
    output += str(count) + char     # Account for final digit
    return output


@pytest.mark.parametrize('start,finish', [
    ('1', '11'),
    ('11', '21'),
    ('21', '1211'),
    ('211', '1221'),
    ('1211', '111221'),
{'fraction_non_alphanumeric': 0.1414885777450258, 'fraction_numerical': 0.06927044952100221, 'mean_word_length': 2.210401891252955, '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': '1268125', 'n_tokens_mistral': 508, 'n_tokens_neox': 448, 'n_words': 121}