<commit_before>from group.models import Group
from group.models import UserGroups
from account.models import User
from group.serializers import GroupSerializer
from group.serializers import JoinedGroupsSerializer
import time


def group_exist(group_name):
    query_set = Group.objects.all().filter(name=group_name)
    if query_set.exists():
        return True
    else:
        return False

def create_home_group(creator, home_id):
    group = Group(name=home_id, creator=creator, type='H')
    group.save()

def create_group(creator, category='H'):
    group_name = create_group_name(creator)
    group = Group(name=group_name, creator=creator, type=category)
    group.save()
    return group_name


def create_group_name(creator):
    length = 8
    time_length = 13
    identity = creator[length*-1:]
    time_str = str(time.time())[:time_length].replace('.', '')
    return identity + time_str


def join_to_group(username, group):
    new_join = UserGroups(user=username, group=group)
    new_join.save()


def get_member_joined_groups(username):<commit_msg>add spaces<commit_after>from group.models import Group
from group.models import UserGroups
from account.models import User
from group.serializers import GroupSerializer
from group.serializers import JoinedGroupsSerializer
import time


def group_exist(group_name):
    query_set = Group.objects.all().filter(name=group_name)
    if query_set.exists():
        return True
    else:
        return False


def create_home_group(creator, home_id):
    group = Group(name=home_id, creator=creator, type='H')
    group.save()


def create_group(creator, category='H'):
    group_name = create_group_name(creator)
    group = Group(name=group_name, creator=creator, type=category)
    group.save()
    return group_name


def create_group_name(creator):
    length = 8
    time_length = 13
    identity = creator[length*-1:]
    time_str = str(time.time())[:time_length].replace('.', '')
    return identity + time_str


def join_to_group(username, group):
    new_join = UserGroups(user=username, group=group)
    new_join.save()


def get_member_joined_groups(username):
{'fraction_non_alphanumeric': 0.10210772833723654, 'fraction_numerical': 0.003747072599531616, 'mean_word_length': 4.533678756476684, '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': '2747420', 'n_tokens_mistral': 668, 'n_tokens_neox': 649, 'n_words': 150}