<commit_before>from pymongo import MongoClient

client = MongoClient()
db = client.college

def addUser(list):
    db.user.insert({'id':list['id'], 'pw':list['pw'], 
                    'info':('name':list['name'], 'address':list['address'], 'email':list['email'], 'phone':list['phone']),
                    'scores':[list['sat1'], list['sat2']), 'preferences':list['preferences']})

def db_valid_youpass(user,password):
    
    
def getPrefs(id):
    return db.user.find_one({'id':id}, fields={'preferences':True, '_id':False})    
    
def loadUser(id):
    return db.user.find_one({'id':id})

def getScores(id):
    return db.user.find_one({'id':id}, fields={'_id':False, 'scores':True})

def getInfo(id):
    return db.user.find_one({'id':id}, fields={'_id':False, 'info':True})

def updateInfo(id, info):
    db.user.update({'id':id}, {'info':info})

def updatePref(id, pref):
    db.user.update({'id':id}, {'info':info})

def updateAddr(id,addr):
    info = getInfo(id)
    info['address'] = addr
    updateInfo(id, info)

def updateEmail(id, email):
    info = getInfo(id)
    info['email'] = email
    updateInfo(id, info)

def updatePhone(id, phone):
    info = getInfo(id)
    info['phone'] = phone
    updateInfo(id, info)
<commit_msg>not sure what else<commit_after>from pymongo import MongoClient

client = MongoClient()
db = client.college

def db_add_user(uid, name, email, pw):
    db.user.insert({'uid':uid, 'pw':pw, 
                    'name':name, 'email':email})

def get_next_uid():
    return len(db.user.find()) + 1

def db_valid_upass(id,pw):
    user = db.user.find_one({'id':id}, fields{'preferences':True, '_id':False})
    if users['pw'] == pw:
        return True
    return False

def db_name_taken(id):
    user = db.user.find({'id':id})
    return len(user) == 1

def db_email_taken(email):
    return len(db.user.find({'email':email})) == 1
    

def getPrefs(id):
    return db.user.find_one({'id':id}, fields={'preferences':True, '_id':False})    
    
def db_load_user(id):
    return db.user.find_one({'id':id})

def getScores(id):
    return db.user.find_one({'id':id}, fields={'_id':False, 'scores':True})

def getInfo(id):
    return db.user.find_one({'id':id}, fields={'_id':False, 'info':True})

def updateInfo(id, info):
    db.user.update({'id':id}, {'info':info})

def updatePref(id, pref):
    db.user.update({'id':id}, {'info':info})

def updateAddr(id,addr):
    info = getInfo(id)
    info['address'] = addr
    updateInfo(id, info)

def updateEmail(id, email):
    info = getInfo(id)
    info['email'] = email
    updateInfo(id, info)

def updatePhone(id, phone):
    info = getInfo(id)
    info['phone'] = phone
    updateInfo(id, info)

{'fraction_non_alphanumeric': 0.19806763285024154, 'fraction_numerical': 0.0018580453363062058, 'mean_word_length': 4.069679849340866, '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': '5055403', 'n_tokens_mistral': 992, 'n_tokens_neox': 977, 'n_words': 187}