<commit_before>"""
Utilities for writing unit tests for the core.
"""
from __future__ import division, print_function, with_statement


def get_intervals_from_function(function):
    """Returns a dictionary of parameter titles and ranges."""
    # TODO port the following dictionary comprehension to Python 2.6 and 2.5
    return {key: function.param_spec.params[key].interval
            for key in function.param_spec.params.keys()}<commit_msg>port dictionary comprehension to Python <= 2.6<commit_after>"""
Utilities for writing unit tests for the core.
"""
from __future__ import division, print_function, with_statement


def get_intervals_from_function(function):
    """Returns a dictionary of parameter titles and ranges."""
    intervals = dict()
    for key in function.param_spec.params.keys():
        intervals[key] = function.param_spec.params[key].interval
    return intervals
{'fraction_non_alphanumeric': 0.08968609865470852, 'fraction_numerical': 0.006726457399103139, 'mean_word_length': 4.616352201257862, 'pattern_counts': {'":': 0, '<': 4, '<?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': '7126484', 'n_tokens_mistral': 233, 'n_tokens_neox': 229, 'n_words': 82}