<commit_before>from mcapp import app
from decorators import crossdomain, apikey, jsonp
import json
from flask import g, jsonify, request
import rethinkdb as r
import access

@app.route('/private/users', methods = ['GET'])
@apikey
@jsonp
def get_users():
    selection = list(r.table('users').pluck('name', 'id').run(g.conn))
    return json.dumps(selection)

@app.route('/private/user/<user>', methods = ['GET'])
@apikey
@jsonp
def get_user(user):
    u = r.table('users').get(user).pluck('name', 'id', 'apikey').run(g.conn)
    return jsonify(u)

@app.route('/private/user', methods=['PUT'])
@apikey
@crossdomain(origin='*')
def update_user():
    user = request.get_json()
    rv = r.table('users').update(user).run(g.conn)
    return jsonify(rv)

@app.route('/selected_users', methods = ['GET'])
@apikey
@jsonp
def selected_users_from_usergroups():
    user = access.get_user()
    allowedUsers = list(r.table('usergroups')\
                        .filter(r.row['users'].contains(user))\
                        .concat_map(lambda g: g['users']).distinct().difference([user]).run(g.conn))
    return json.dumps(allowedUsers)<commit_msg>Fix formatting issues.<commit_after>from mcapp import app
from decorators import crossdomain, apikey, jsonp
import json
from flask import g, jsonify, request
import rethinkdb as r
import access


@app.route('/private/users', methods=['GET'])
@apikey
@jsonp
def get_users():
    selection = list(r.table('users').pluck('name', 'id').run(g.conn))
    return json.dumps(selection)


@app.route('/private/user/<user>', methods=['GET'])
@apikey
@jsonp
def get_user(user):
    u = r.table('users').get(user).pluck('name', 'id', 'apikey').run(g.conn)
    return jsonify(u)


@app.route('/private/user', methods=['PUT'])
@apikey
@crossdomain(origin='*')
def update_user():
    user = request.get_json()
    rv = r.table('users').update(user).run(g.conn)
    return jsonify(rv)


@app.route('/selected_users', methods=['GET'])
@apikey
@jsonp
def selected_users_from_usergroups():
    user = access.get_user()
    allowedUsers = list(r.table('usergroups')
                        .filter(r.row['users'].contains(user))
                        .concat_map(lambda g: g['users']).distinct()
                        .difference([user]).run(g.conn))
    return json.dumps(allowedUsers)
{'fraction_non_alphanumeric': 0.1787878787878788, 'fraction_numerical': 0.0, 'mean_word_length': 4.0130151843817785, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3915230', 'n_tokens_mistral': 776, 'n_tokens_neox': 760, 'n_words': 155}