<commit_before>from drone.api_start import api
from drone.main import db
from drone.models import UserModel
from flask import request,current_app
from drone.utility.nishu import add_user_in_db,get_user_names

@api.route('/',methods=['GET'])
def start():
    count = db.session.query(UserModel).count()
    return "Count of users from psql "+str(count)

@api.route('/users',methods=['GET'])
def users():
    all_users = get_user_names()
    return all_users

@api.route('/users',methods=['POST'])
def insert_user():
    data = request.get_json()

    if not data or 'id' not in data :
        return "Data is not provided ",414

    add_user_in_db(data)
    return "ok",200<commit_msg>api to store user credentials and send the api key<commit_after>from drone.api_start import api
from drone.main import db
from drone.models import UserModel
from flask import request,current_app
from drone.utility.nishu import add_user_in_db,get_user_names,set_user_credentials

@api.route('/',methods=['GET'])
def start():
    count = db.session.query(UserModel).count()
    return "Count of users from psql "+str(count)

@api.route('/users',methods=['GET'])
def users():
    all_users = get_user_names()
    return all_users

@api.route('/users',methods=['POST'])
def insert_user():
    data = request.get_json()

    if not data or 'id' not in data :
        return "Data is not provided ",414

    add_user_in_db(data)
    return "ok",200

@api.route('/new_user',methods=['POST'])
def new_User():
    user = request.get_json()

    if not user or 'username' and 'password' not in user :
        return "Data is not Valid",414

    set_user_credentials(user)
    return "ok",200
{'fraction_non_alphanumeric': 0.12732732732732732, 'fraction_numerical': 0.010810810810810811, 'mean_word_length': 4.322683706070287, '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': '330337', 'n_tokens_mistral': 560, 'n_tokens_neox': 531, 'n_words': 153}