<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import g, jsonify
from flask.ext.restful import Resource
from flask.ext.restful import reqparse
from flask.ext.httpauth import HTTPBasicAuth
from ..lib.util import *
from ..models import *
from . import Login
auth = HTTPBasicAuth()


class userView(Resource):

    def get(self, id):
        user = User.query.filter_by(id=id).first()
        userInfor = {}
        userInfor['username'] = user.username
        userInfor['email'] = user.email
        userInfor['birthday'] = user.birthday
        userInfor['province'] = user.province
        userInfor['district'] = user.district
        userInfor['sex'] = user.sex
        if user is None:
            return {'status': 'fail', "mesg": "该用户不存在!"}<commit_msg>add function of query user infor<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import g, jsonify
from flask.ext.restful import Resource
from flask.ext.restful import reqparse
from flask.ext.httpauth import HTTPBasicAuth
from ..lib.util import *
from ..models import *
from . import Login
auth = HTTPBasicAuth()


class userView(Resource):

    def get(self, id):
        user = User.query.filter_by(id=id).first()
        userInfor = {}
        userInfor['username'] = user.username
        userInfor['email'] = user.email
        userInfor['birthday'] = user.birthday
        userInfor['province'] = user.province
        userInfor['name'] = user.name
        userInfor['district'] = user.district
        userInfor['sex'] = user.sex
        if user is None:
            return {'status': 'fail', "mesg": "该用户不存在!"}
{'fraction_non_alphanumeric': 0.133086876155268, 'fraction_numerical': 0.0012322858903265558, 'mean_word_length': 2.9609756097560975, 'pattern_counts': {'":': 2, '<': 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': '6229025', 'n_tokens_mistral': 519, 'n_tokens_neox': 498, 'n_words': 128}