<commit_before>from django.db import models
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
from datetime import datetime

class School (models.Model):
  name = models.CharField(max_length = 200)

class Avatar (models.Model):
  name = models.CharField(max_length = 200)

class Teacher (models.Model):
  name = models.CharField(max_length = 200)
  user = models.OneToOneField(User)
  avatar = models.CharField(max_length = 200)

class Class (models.Model):
  name = models.CharField(max_length = 200)
  school = models.ForeignKey(School, related_name='class_school')
  teacher = models.ForeignKey(Teacher, related_name='class_teacher')

  def get_logged_in_students(self):
    """This gets all the students who are logged in."""
    sessions = Session.objects.filter(expire_date__gte=datetime.now())
    uid_list = []

    # Build a list of user ids from that query
    for session in sessions:
        data = session.get_decoded()<commit_msg>Going back from having set group of avatars to being able to upload your own. Will probably use PIL.<commit_after>from django.db import models
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
from datetime import datetime

class School (models.Model):
  name = models.CharField(max_length = 200)

class Teacher (models.Model):
  name = models.CharField(max_length = 200)
  user = models.OneToOneField(User)
  avatar = models.CharField(max_length = 200)

class Class (models.Model):
  name = models.CharField(max_length = 200)
  school = models.ForeignKey(School, related_name='class_school')
  teacher = models.ForeignKey(Teacher, related_name='class_teacher')

  def get_logged_in_students(self):
    """This gets all the students who are logged in."""
    sessions = Session.objects.filter(expire_date__gte=datetime.now())
    uid_list = []

    # Build a list of user ids from that query
    for session in sessions:
        data = session.get_decoded()
{'fraction_non_alphanumeric': 0.09593169261677549, 'fraction_numerical': 0.013561024610748368, 'mean_word_length': 4.627118644067797, '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': '6108976', 'n_tokens_mistral': 626, 'n_tokens_neox': 591, 'n_words': 171}