<commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2012 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
"""
pycroft.lib.user
~~~~~~~~~~~~~~

This module contains.

:copyright: (c) 2012 by AG DSN.
"""

from datetime import datetime, timedelta
from sqlalchemy.sql.expression import func
from pycroft.helpers import user_helper, host_helper
from pycroft.model.accounting import TrafficVolume
from pycroft.model.dormitory import Dormitory, Room, Subnet, VLan
from pycroft.model.hosts import Host, NetDevice, Ip, ARecord, CNameRecord
from pycroft.model.logging import UserLogEntry
from pycroft.model.properties import TrafficGroup, Membership, Group
from pycroft.model.finance import FinanceAccount, Transaction, Split, Semester
from pycroft.model import session
from pycroft.model.user import User
from pycroft.lib import user_config


def moves_in(name, login, dormitory, level, room_number, host_name, mac, current_semester, processor):

    room = Room.q.filter_by(number=room_number,
        level=level, dormitory_id=dormitory.id).one()

    # create a new user
    new_user = User(login=login,
        name=name,
        room=room,
        registration_date=datetime.now())
    plain_password = user_helper.generatePassword(12)<commit_msg>add docstring to user move<commit_after># -*- coding: utf-8 -*-
# Copyright (c) 2012 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
"""
pycroft.lib.user
~~~~~~~~~~~~~~

This module contains.

:copyright: (c) 2012 by AG DSN.
"""

from datetime import datetime, timedelta
from flask.ext.login import current_user
from sqlalchemy.sql.expression import func
from pycroft.helpers import user_helper, host_helper
from pycroft.model.accounting import TrafficVolume
from pycroft.model.dormitory import Dormitory, Room, Subnet, VLan
from pycroft.model.hosts import Host, NetDevice, Ip, ARecord, CNameRecord
from pycroft.model.logging import UserLogEntry
from pycroft.model.properties import TrafficGroup, Membership, Group
from pycroft.model.finance import FinanceAccount, Transaction, Split, Semester
from pycroft.model import session
from pycroft.model.user import User
from pycroft.lib import user_config


def moves_in(name, login, dormitory, level, room_number, host_name, mac, current_semester, processor):

    room = Room.q.filter_by(number=room_number,
        level=level, dormitory_id=dormitory.id).one()

    # create a new user
    new_user = User(login=login,
        name=name,
        room=room,
        registration_date=datetime.now())
    plain_password = user_helper.generatePassword(12)
{'fraction_non_alphanumeric': 0.09071580439404678, 'fraction_numerical': 0.009213323883770375, 'mean_word_length': 4.74949083503055, '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': '4077143', 'n_tokens_mistral': 878, 'n_tokens_neox': 809, 'n_words': 277}