<commit_before># -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date:   2017-04-27 12:49:17
# @Last Modified by:   <NAME>
# @Last Modified time: 2017-09-27 09:53:24

"""
battle_tested - automated function fuzzing library to quickly test production
                code to prove it is "battle tested" and safe to use.

Examples of Primary Uses:

    from battle_tested import fuzz

    def test_function(a,b,c):
        return c,b,a

    fuzz(test_function)
    # or to collect tests
    fuzz(test_function, keep_testing=True)

Or:

    from battle_tested import battle_tested

    @battle_tested()
    def test_function(a,b,c):
        return c,b,a

"""

from __future__ import print_function, unicode_literals
from collections import deque
from functools import wraps, partial
from gc import collect as gc
from hypothesis import given, strategies as st, settings, Verbosity, unlimited
from hypothesis.errors import HypothesisException
from inspect import getsource
from itertools import product, cycle, chain, islice
from prettytable import PrettyTable
from random import choice, randint
from re import findall
from stricttuple import stricttuple
from string import ascii_letters, digits
from time import time
import generators as gen
import logging
import signal
import sys
import traceback


__all__ = 'battle_tested', 'fuzz', 'disable_traceback', 'enable_traceback', 'garbage', 'crash_map', 'success_map', 'results', 'stats', 'print_stats', 'function_versions', 'time_all_versions_of', 'easy_street'


def cycle_combinations(*gens):
    l_gen = len(gens)
    while 1:<commit_msg>added the shorten function that will be used to clean the tables<commit_after># -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date:   2017-04-27 12:49:17
# @Last Modified by:   <NAME>
# @Last Modified time: 2017-09-30 22:00:43

"""
battle_tested - automated function fuzzing library to quickly test production
                code to prove it is "battle tested" and safe to use.

Examples of Primary Uses:

    from battle_tested import fuzz

    def test_function(a,b,c):
        return c,b,a

    fuzz(test_function)
    # or to collect tests
    fuzz(test_function, keep_testing=True)

Or:

    from battle_tested import battle_tested

    @battle_tested()
    def test_function(a,b,c):
        return c,b,a

"""

from __future__ import print_function, unicode_literals
from collections import deque
from functools import wraps, partial
from gc import collect as gc
from hypothesis import given, strategies as st, settings, Verbosity, unlimited
from hypothesis.errors import HypothesisException
from inspect import getsource
from itertools import product, cycle, chain, islice
from prettytable import PrettyTable
from random import choice, randint
from re import findall
from stricttuple import stricttuple
from string import ascii_letters, digits
from time import time
import generators as gen
import logging
import signal
import sys
import traceback


__all__ = 'battle_tested', 'fuzz', 'disable_traceback', 'enable_traceback', 'garbage', 'crash_map', 'success_map', 'results', 'stats', 'print_stats', 'function_versions', 'time_all_versions_of', 'easy_street'

def shorten(string, max_length=80, trailing_chars=3):
    ''' trims the 'string' argument down to 'max_length' to make previews to long string values '''
    assert type(string).__name__ in {'str', 'unicode'}, 'shorten needs string to be a string, not {}'.format(type(string))
    assert type(max_length) == int, 'shorten needs max_length to be an int, not {}'.format(type(max_length))
    assert type(trailing_chars) == int, 'shorten needs trailing_chars to be an int, not {}'.format(type(trailing_chars))
    assert max_length > 0, 'shorten needs max_length to be positive, not {}'.format(max_length)
    assert trailing_chars >= 0, 'shorten needs trailing_chars to be greater than or equal to 0, not {}'.format(trailing_chars)

    return (
        string
    ) if len(string) <= max_length else (
        '{before:}...{after:}'.format(
            before=string[:max_length-(trailing_chars+3)],
            after=string[-trailing_chars:] if trailing_chars>0 else ''
        )
    )

def cycle_combinations(*gens):
    l_gen = len(gens)
    while 1:
{'fraction_non_alphanumeric': 0.09296781883194279, 'fraction_numerical': 0.016209773539928488, 'mean_word_length': 4.372599231754162, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, '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': '1649431', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1240, 'n_words': 443}