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

from google.appengine.ext import ndb


class ModelUser(ndb.Model):
    email = ndb.StringProperty()
    url_email_validation = ndb.StringProperty()
    date_last_vote = ndb.DateTimeProperty()
    password = ndb.StringProperty()
    name = ndb.StringProperty()
    surname = ndb.StringProperty()


def generate_data(n):
    assert (isinstance(n, int) is True and 0 < n < 1001)
    password_prefix = '<PASSWORD>'

    def generate_word():
        import random
        import string

        vowels = 'aeiou'
        consonants = ''.join(set(string.ascii_lowercase) - set(vowels))

        w = ''
        for i in range(random.choice(range(7, 12))):
            if i % 2 == 0:
                w += random.choice(vowels)
            elif i % 5 == 0:
                w += random.choice(consonants) * 2
            else:
                w += random.choice(consonants)
        return w

    ldata = []
    for _ in range(n):
        m = {
            'email': generate_word() + '@vote<EMAIL>.<EMAIL>',
            'url_email_validation': '',
            'date_last_vote': None,
            'password': password_prefix + generate_word(),
            'name': generate_word(),
            'surname': generate_word()
        }
        ldata.append(m)

    return ldata<commit_msg>feat: generation data refactor<commit_after># -*- coding: utf-8 -*-

from google.appengine.ext import ndb


class ModelUser(ndb.Model):
    email = ndb.StringProperty()
    url_email_validation = ndb.StringProperty()
    date_last_vote = ndb.DateTimeProperty()
    password = ndb.StringProperty()
    name = ndb.StringProperty()
    surname = ndb.StringProperty()


EMAIL_ADDRESS = <EMAIL>'
MIN = 6
MAX = 16


def generate_data(n):
    assert (isinstance(n, int) is True and 0 < n < 1001)
    password_prefix = '<PASSWORD>_'

    def generate_word():
        import random
        import string

        vowels = 'aeiou'
        consonants = ''.join(set(string.ascii_lowercase) - set(vowels))

        w = ''
        for i in range(random.choice(range(MIN, MAX))):
            if i % 2 == 0:
                w += random.choice(vowels)
            elif i % 5 == 0:
                w += random.choice(consonants) * 2
            else:
                w += random.choice(consonants)
        return w

    ldata = []
    for _ in range(n):
        m = {
            'email': generate_word() + EMAIL_ADDRESS,
            'url_email_validation': '',
            'date_last_vote': None,
            'password': <PASSWORD>(),
            'name': generate_word(),
            'surname': generate_word()
        }
        ldata.append(m)

    return ldata
{'fraction_non_alphanumeric': 0.12580037664783428, 'fraction_numerical': 0.010546139359698682, 'mean_word_length': 1.9842696629213483, 'pattern_counts': {'":': 0, '<': 13, '<?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': '1623759', 'n_tokens_mistral': 861, 'n_tokens_neox': 812, 'n_words': 187}