<commit_before>from views import *
from lookups import *
import requests
import re
from utils import *
import itertools
from config import config
if config.IMPORT_PYSAM_PRIMER3:
    import pysam
import csv
#hpo lookup
import orm


@app.route('/individual_json/<individual>')
@requires_auth
def individual_json(individual):
    db=get_db()
    hpo_db=get_db(app.config['DB_NAME_HPO'])
    patient_db=get_db(app.config['DB_NAME_PATIENTS'])
    #if not patient: return jsonify(result=None)
    patient = patient_db.patients.find_one({'external_id':individual},{'_id':False})
    patient['features']=[f for f in patient['features'] if f['observed']=='yes']
    print(patient)
    return jsonify(result=patient)

@app.route('/edit_patient_features/<individual>',methods=['POST'])
@requires_auth
def edit_patient_features(individual):<commit_msg>individual.py quick hack to prevent demo user from editing phenotype<commit_after>from views import *
from lookups import *
import requests
import re
from utils import *
import itertools
from config import config
if config.IMPORT_PYSAM_PRIMER3:
    import pysam
import csv
#hpo lookup
import orm


@app.route('/individual_json/<individual>')
@requires_auth
def individual_json(individual):
    db=get_db()
    hpo_db=get_db(app.config['DB_NAME_HPO'])
    patient_db=get_db(app.config['DB_NAME_PATIENTS'])
    #if not patient: return jsonify(result=None)
    patient = patient_db.patients.find_one({'external_id':individual},{'_id':False})
    patient['features']=[f for f in patient['features'] if f['observed']=='yes']
    print(patient)
    return jsonify(result=patient)

@app.route('/edit_patient_features/<individual>',methods=['POST'])
@requires_auth
def edit_patient_features(individual):
    if session['user']=='demo': return 'not permitted'
{'fraction_non_alphanumeric': 0.12625698324022347, 'fraction_numerical': 0.0011173184357541898, 'mean_word_length': 6.4625, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3667822', 'n_tokens_mistral': 605, 'n_tokens_neox': 568, 'n_words': 127}