<commit_before># -*- encoding: UTF-8 -*-

from random import randint
from cvn import settings as st_cvn
import random
import datetime


def fuzzy_date():
    start = datetime.date(randint(1940, 2040), randint(1, 12), randint(1, 28))
    end = datetime.date(randint(start.year, 2040), randint(start.month, 12),
                        randint(start.day, 28))
    return [start, end]

class ProfessionFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        d = {'title': 'Titulo ' + str(randint(0, 100)),
             'employer': 'Empresa ' + str(randint(0, 100)),
             'start_date': fd[0]}
        if random.choice([True, False]):
            d['end_date'] = fd[1]
        if random.choice([True, False]):
            d['centre'] = 'Centro ' + str(randint(0, 100))
        if random.choice([True, False]):
            d['department'] = 'Departamento ' + str(randint(0, 100))
        if random.choice([True, False]):
            d['full_time'] = random.choice([True, False])
        return d


class TeachingPhdFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        d = {'title': 'Titulo ' + str(randint(0, 100)),
             'reading_date': fd[0],
             'author_first_name': random.choice(['Cacerolo', 'Espinacia',
                                                 'Caralampio', 'Diodora']),
             'author_last_name': u'Rodríguez' + random.choice([u' Martín', ''])}

        if random.choice([True, False]):
            d['university'] = 'Universidad #' + str(randint(0, 100))
        if random.choice([True, False]):
            d['codirector_first_name'] = 'Aceitunio'
        if random.choice([True, False]):
            d['codirector_last_name'] = (u'Rodríguez' +
                                         random.choice([u' Martín', '']))
        return d


class LearningOtherFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        return {'type': random.choice(['Curso', 'Conferencia', 'Taller']),
             'title': 'Titulo #' + str(randint(0, 100)),
             'duration': str(randint(1, 100)),
             'start_date': fd[0],
             'end_date': fd[1]}


class LearningPhdFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        return {'title': 'Titulo #' + str(randint(0, 100)),
                'university': 'Universidad #' + str(randint(0, 100)),
                'date': fd[0]}


class TeachingFactory:

    @staticmethod
    def create():
        program_type = u'Titulación #' + str(randint(0, 100))
        if random.choice([True, False]):
            program_type = random.choice(st_cvn.FC_PROGRAM_TYPE.keys())
        subject_type = 'Tipo asignatura #' + str(randint(0, 100))
        if random.choice([True, False]):
            subject_type = random.choice(st_cvn.FC_SUBJECT_TYPE.keys())
        return {'subject': 'Asignatura #' + str(randint(0, 100)),
                'professional_category': u'Profesión #' + str(randint(0, 100)),
                'program_type': program_type,
                'subject_type': subject_type,
                'course': randint(0, 5),
                'qualification': random.choice(['',
                                                u'Titulación #' +
                                                str(randint(0, 100))]),
                'department': random.choice(['', 'Departamento #' +
                                             str(randint(0, 100))]),
                'faculty': random.choice(['', 'Facultad #' +
                                          str(randint(0, 100))]),
                'school_year': randint(1990, 2020),
                'number_credits': format(random.uniform(0, 20), '.1f'),
                'university': random.choice(['', st_cvn.UNIVERSITY,
                                             'Universidad #' +
                                             str(randint(0, 100))]),
                }


class LearningFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        fd.append(None)
        return {'title': u'Título #' + str(randint(0, 100)),<commit_msg>Changed random generation of data for fields 'professional_category', 'course', 'qualifications' and 'faculty' in TeachingFactory<commit_after># -*- encoding: UTF-8 -*-

from random import randint
from cvn import settings as st_cvn
import random
import datetime


def fuzzy_date():
    start = datetime.date(randint(1940, 2040), randint(1, 12), randint(1, 28))
    end = datetime.date(randint(start.year, 2040), randint(start.month, 12),
                        randint(start.day, 28))
    return [start, end]

class ProfessionFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        d = {'title': 'Titulo ' + str(randint(0, 100)),
             'employer': 'Empresa ' + str(randint(0, 100)),
             'start_date': fd[0]}
        if random.choice([True, False]):
            d['end_date'] = fd[1]
        if random.choice([True, False]):
            d['centre'] = 'Centro ' + str(randint(0, 100))
        if random.choice([True, False]):
            d['department'] = 'Departamento ' + str(randint(0, 100))
        if random.choice([True, False]):
            d['full_time'] = random.choice([True, False])
        return d


class TeachingPhdFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        d = {'title': 'Titulo ' + str(randint(0, 100)),
             'reading_date': fd[0],
             'author_first_name': random.choice(['Cacerolo', 'Espinacia',
                                                 'Caralampio', 'Diodora']),
             'author_last_name': u'Rodríguez' + random.choice([u' Martín', ''])}

        if random.choice([True, False]):
            d['university'] = 'Universidad #' + str(randint(0, 100))
        if random.choice([True, False]):
            d['codirector_first_name'] = 'Aceitunio'
        if random.choice([True, False]):
            d['codirector_last_name'] = (u'Rodríguez' +
                                         random.choice([u' Martín', '']))
        return d


class LearningOtherFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        return {'type': random.choice(['Curso', 'Conferencia', 'Taller']),
             'title': 'Titulo #' + str(randint(0, 100)),
             'duration': str(randint(1, 100)),
             'start_date': fd[0],
             'end_date': fd[1]}


class LearningPhdFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        return {'title': 'Titulo #' + str(randint(0, 100)),
                'university': 'Universidad #' + str(randint(0, 100)),
                'date': fd[0]}


class TeachingFactory:

    @staticmethod
    def create():
        program_type = u'Titulación #' + str(randint(0, 100))
        if random.choice([True, False]):
            program_type = random.choice(st_cvn.FC_PROGRAM_TYPE.keys())
        subject_type = 'Tipo asignatura #' + str(randint(0, 100))
        if random.choice([True, False]):
            subject_type = random.choice(st_cvn.FC_SUBJECT_TYPE.keys())
        return {'subject': 'Asignatura #' + str(randint(0, 100)),
                'professional_category': random.choice(
                    ['', u'Profesión #' + str(randint(0, 100))]),
                'program_type': program_type,
                'subject_type': subject_type,
                'course': random.choice(['', str(randint(0, 5))]),
                'qualification': u'Titulación #' + str(randint(0, 100)),
                'department': random.choice(['', 'Departamento #' +
                                             str(randint(0, 100))]),
                'faculty': 'Facultad #' + str(randint(0, 100)),
                'school_year': randint(1990, 2020),
                'number_credits': format(random.uniform(0, 20), '.1f'),
                'university': random.choice(['', st_cvn.UNIVERSITY,
                                             'Universidad #' +
                                             str(randint(0, 100))]),
                }


class LearningFactory:

    @staticmethod
    def create():
        fd = fuzzy_date()
        fd.append(None)
        return {'title': u'Título #' + str(randint(0, 100)),
{'fraction_non_alphanumeric': 0.153076171875, 'fraction_numerical': 0.029052734375, 'mean_word_length': 1.933404940923738, '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': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '465979', 'n_tokens_mistral': 2687, 'n_tokens_neox': 2394, 'n_words': 506}