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

import datetime
import inspect
import textwrap

from openfisca_core.indexed_enums import Enum


def get_next_day(date):
    parsed_date = date
    next_day = parsed_date + datetime.timedelta(days = 1)
    return next_day.isoformat().split('T')[0]


def get_default_value(variable):
    default_value = variable.default_value
    if isinstance(default_value, datetime.date):
        return default_value.isoformat()

    if isinstance(default_value, Enum):
        return default_value.name

    return default_value


def build_source_url(country_package_metadata, source_file_path, start_line_number, source_code):
    nb_lines = source_code.count('\n')
    return '{}/blob/{}{}#L{}-L{}'.format(
        country_package_metadata['repository_url'],
        country_package_metadata['version'],
        source_file_path,
        start_line_number,
        start_line_number + nb_lines - 1,
        ).encode('utf-8')

<commit_msg>Fix encoding for utf-8 variable paths<commit_after># -*- coding: utf-8 -*-

import datetime
import inspect
import textwrap

from openfisca_core.indexed_enums import Enum


def get_next_day(date):
    parsed_date = date
    next_day = parsed_date + datetime.timedelta(days = 1)
    return next_day.isoformat().split('T')[0]


def get_default_value(variable):
    default_value = variable.default_value
    if isinstance(default_value, datetime.date):
        return default_value.isoformat()

    if isinstance(default_value, Enum):
        return default_value.name

    return default_value


def build_source_url(country_package_metadata, source_file_path, start_line_number, source_code):
    nb_lines = source_code.count('\n')
    return u'{}/blob/{}{}#L{}-L{}'.format(
        country_package_metadata['repository_url'],
        country_package_metadata['version'],
        source_file_path,
        start_line_number,
        start_line_number + nb_lines - 1,
        )


{'fraction_non_alphanumeric': 0.10437017994858612, 'fraction_numerical': 0.005141388174807198, 'mean_word_length': 3.8287841191067, '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': '2757735', 'n_tokens_mistral': 612, 'n_tokens_neox': 598, 'n_words': 116}