<commit_before>from application import db
from application.user.models import User, UserPermission

user_group = db.Table('user_group',
	db.Column('user_id', db.Integer, db.ForeignKey('user.id')),
	db.Column('group_id', db.Integer, db.ForeignKey('group.id'))
)

class Group(db.Model):
	__tablename__ = 'group'

	id = db.Column(db.Integer, primary_key=True)
	name = db.Column(db.String(256), unique=True)
	users = db.relationship('User', secondary=user_group,
		backref=db.backref('groups', lazy='dynamic'), lazy='dynamic')
	user_permissions = db.relationship('UserPermission', uselist=False,
		backref='group')
	group_permissions = db.relationship('GroupPermission', uselist=False,
		backref='group')
	page_permissions = db.relationship('PagePermission', backref='group')

	def __init__(self, name):
		self.name = name

	def has_user(self, user):
		return self.users.filter(user_group.c.user_id == user.id).count() > 0
	
	def add_user(self, user):<commit_msg>Fixing the relationships.<commit_after>from application import db
from application.user.models import User, UserPermission

user_group = db.Table('user_group',
	db.Column('user_id', db.Integer, db.ForeignKey('user.id')),
	db.Column('group_id', db.Integer, db.ForeignKey('group.id'))
)

class Group(db.Model):
	__tablename__ = 'group'

	id = db.Column(db.Integer, primary_key=True)
	name = db.Column(db.String(256), unique=True)
	users = db.relationship('User', secondary=user_group,
		backref=db.backref('groups', lazy='dynamic'), lazy='dynamic')
	user_permissions = db.relationship('UserPermission', uselist=False,
		backref='group')
	group_permissions = db.relationship('GroupPermission', uselist=False,
		backref='group')
	page_permissions = db.relationship('PagePermission', backref='group',
		lazy='dynamic')

	def __init__(self, name):
		self.name = name

	def has_user(self, user):
		return self.users.filter(user_group.c.user_id == user.id).count() > 0
	
	def add_user(self, user):
{'fraction_non_alphanumeric': 0.1555441478439425, 'fraction_numerical': 0.004106776180698152, 'mean_word_length': 6.467432950191571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5256940', 'n_tokens_mistral': 682, 'n_tokens_neox': 642, 'n_words': 120}