<commit_before>"""Data generators for big_O module."""

# Author: <NAME> < pietro _DOT_ berkes _AT_ googlemail _DOT_ com >
# Copyright (c) 2011 <NAME>
# License: GPL v3

# TODO: add generators for random strings

import random

def n_(n):
    """Return N."""
    return n

def range_n(n, start=0):
    """Return the sequence [start, start+1, ..., start+N-1]."""
    return range(start, start+n)

def integers(n, min_, max_):
    """Return sequence of N random integers between min_ and max_ (included).
    """
    return [random.randint(min_, max_) for _ in range(n)]

def large_integers(n):
    """Return sequence of N large random integers."""
    return [random.randint(-50, 50) * 1000000 + random.randint(0,10000)
            for _ in range(n)]<commit_msg>NEW: generator for random strings<commit_after>"""Data generators for big_O module."""

# Author: <NAME> < pietro _DOT_ berkes _AT_ googlemail _DOT_ com >
# Copyright (c) 2011 <NAME>
# License: GPL v3

import random
import string

def n_(n):
    """Return N."""
    return n

def range_n(n, start=0):
    """Return the sequence [start, start+1, ..., start+N-1]."""
    return range(start, start+n)

def integers(n, min_, max_):
    """Return sequence of N random integers between min_ and max_ (included).
    """
    return [random.randint(min_, max_) for _ in range(n)]

def large_integers(n):
    """Return sequence of N large random integers."""
    return [random.randint(-50, 50) * 1000000 + random.randint(0,10000)
            for _ in range(n)]

def strings(n, chars=string.letters):
    """Return random string of N characters, sampled at random from `chars`."""
    return ''.join([random.choice(chars) for i in xrange(n)])
{'fraction_non_alphanumeric': 0.1446280991735537, 'fraction_numerical': 0.0295159386068477, 'mean_word_length': 3.7083333333333335, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6152197', 'n_tokens_mistral': 598, 'n_tokens_neox': 545, 'n_words': 189}