<commit_before>import os
from flask import Flask, render_template, request, jsonify
from app import app, host, port, user, passwd, db
from app.helpers.database import con_db
import sys
import ast
import json
import re
from find_similarity3 import find_companies
from operator import itemgetter

conn = con_db("localhost", 3306, "root", "****", "Venturenetwork18")



# ROUTING/VIEW FUNCTIONS
@app.route('/')
@app.route('/index')
def index():
#testing cursor/SQLconnection here.
#    cur = conn.cursor()
#    cur.execute('SELECT * FROM Investor_comp;')
#    rs = []
#    for r in cur:
#      print r
#      rs.append(str(r))
#    cur.close()
#    return '\n'.join(rs)
    return render_template('index.html')

    
@app.route('/api/users/<investorname>')  #this seems to work
def users(investorname):
    cur = conn.cursor()
    find_investorID = '''SELECT investor_id FROM Investors_info WHERE investor_name="%s";'''% investorname
    cur.execute(find_investorID)
    investorID = cur.fetchall()
    investorID = investorID[0][0]
    [res, score] = find_companies(investorID)
    res2 = []
    cur.close()
    cur = conn.cursor()
    for row in res:
        
            #Statement = '''SELECT startup_name, startup_market, logolink, startupSignal FROM Starup_info WHERE startupID="%s";'''% row[1]<commit_msg>change views.py<commit_after>import os
from flask import Flask, render_template, request, jsonify
from app import app, host, port, user, passwd, db
from app.helpers.database import con_db
import sys
import ast
import json
import re
from find_similarity3 import find_companies
from operator import itemgetter



# ROUTING/VIEW FUNCTIONS
@app.route('/')
@app.route('/index')
def index():
#testing cursor/SQLconnection here.
#    cur = conn.cursor()
#    cur.execute('SELECT * FROM Investor_comp;')
#    rs = []
#    for r in cur:
#      print r
#      rs.append(str(r))
#    cur.close()
#    return '\n'.join(rs)
    return render_template('index.html')

    
@app.route('/api/users/<investorname>')  #this seems to work
def users(investorname):
    conn = con_db("localhost", 3306, "root", "****", "Venturenetwork18")
    cur = conn.cursor()
    find_investorID = '''SELECT investor_id FROM Investors_info WHERE investor_name="%s";'''% investorname
    cur.execute(find_investorID)
    investorID = cur.fetchall()
    investorID = investorID[0][0]
    [res, score] = find_companies(investorID)
    res2 = []
    cur.close()
    cur = conn.cursor()
    for row in res:
        
            #Statement = '''SELECT startup_name, startup_market, logolink, startupSignal FROM Starup_info WHERE startupID="%s";'''% row[1]
{'fraction_non_alphanumeric': 0.13457872664887532, 'fraction_numerical': 0.008387342737323675, 'mean_word_length': 3.8773234200743496, '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': '4372742', 'n_tokens_mistral': 889, 'n_tokens_neox': 852, 'n_words': 228}