<commit_before>import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hertz.settings")

import django

django.setup()

from django.contrib.auth.models import User

from attendance.models import Lecture, Student
from datetime import date, time, timedelta

from faker import Factory

import random

try:
    User.objects.create_superuser('admin', '', 'adminadmin')
except Exception as e:
    print(e)

fake = Factory.create('pt_BR')


for _ in range(10):
    lecture = Lecture(
        title=fake.sentence(nb_words=6, variable_nb_words=True),
        lecturer=f'{fake.first_name()} {fake.last_name()}',
        date=fake.date_object(),
        time=fake.time_object(),
        duration=timedelta(seconds=60 * random.randint(30, 60)),
    )

    print(lecture)

    lecture.save()

for line in open('presencas-seccom2016/seccom2016-estudante.csv'):
    registration, name = line.strip().split(',')

    student = Student(
        registration=registration.zfill(8),
        name=name.strip('"'),
    )

    student.save()

    print(student)
<commit_msg>Populate DB with real student data<commit_after>import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hertz.settings")

import django

django.setup()

from django.contrib.auth.models import User

from attendance.models import Lecture, Student
from datetime import date, time, timedelta

from faker import Factory

import random

try:
    User.objects.create_superuser('admin', '', 'adminadmin')
except Exception as e:
    print(e)

fake = Factory.create('pt_BR')


# for _ in range(10):
#     lecture = Lecture(
#         title=fake.sentence(nb_words=6, variable_nb_words=True),
#         lecturer=f'{fake.first_name()} {fake.last_name()}',
#         date=fake.date_object(),
#         time=fake.time_object(),
#         duration=timedelta(seconds=60 * random.randint(30, 60)),
#     )

#     print(lecture)

#     lecture.save()

# for line in open('presencas-seccom2016/seccom2016-estudante.csv'):
#     registration, name = line.strip().split(',')

#     student = Student(
#         registration=registration.zfill(8),
#         name=name.strip('"'),
#     )

#     student.save()

#     print(student)

{'fraction_non_alphanumeric': 0.13646841862609496, 'fraction_numerical': 0.016597510373443983, 'mean_word_length': 3.6767241379310347, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5472901', 'n_tokens_mistral': 741, 'n_tokens_neox': 707, 'n_words': 139}