<commit_before>import cx_Oracle
import getpass #gets password without echoing
import random

class Search_Engine():
    
    def __init__(self):
        pass
    
    def main(self):
	
	f = open('credentials', 'r')
	#[-1] to trim \n
	username = f.readline()[:-1]
	password = f.readline()[:-1]
	#password = getpass.getpass() # could use this to get password, but doesn't work with IDE

	self.con = cx_Oracle.connect(username + '/' + \
	                        password + '@<PASSWORD>.<EMAIL>:1521/CRS')<commit_msg>added part 1 of search engine<commit_after>import cx_Oracle
import getpass #gets password without echoing
import random
import time


class SearchEngine():
    
    def __init__(self):
        pass
    
    def main(self):
	
        f = open('credentials', 'r')
        #[-1] to trim \n
        username = f.readline()[:-1]
        password = f.readline()[:-1]
        #password = getpass.getpass() # could use this to get password, but doesn't work with IDE

        self.con = cx_Oracle.connect(username + '/' + \
	                        password + <PASSWORD>:1521/CRS')
                            
        go=True                        
        while go:                    
            print("Press 1 for patient search")
            choice=input("What would you like to search by ?")
            if choice == "1":
                go=False
                self.patientSearch()
            else:
                print("Invalid input")
            
    def patientSearch(self):
        go=True
        while go:
            patient,go=self.getPatient()
        curs = self.con.cursor()
        curs.execute("select p.health_care_no,p.name,t.test_name,r.test_date,r.result from \
                          patient p, test_type t, test_record r \
                          where \
                          r.patient_no="+str(patient)+" \
                          and \
                          p.health_care_no=r.patient_no \
                          and \
                          t.type_id=r.type_id")
        rows = curs.fetchall()
        
        for row in rows: 
            list1=[]
            counter=0
            for x in row:       
                if counter == 3:
                    #print(type((x.strftime("%Y-%m-%d %H:%M:%S"))))
                    x=(x.strftime("%Y-%m-%d %H:%M:%S"))
                    x=x[:-9]
                counter+=1
                list1.append(x)
            print(tuple(list1))
{'fraction_non_alphanumeric': 0.11625051166598445, 'fraction_numerical': 0.009823986901350798, 'mean_word_length': 1.3567984570877532, 'pattern_counts': {'":': 1, '<': 6, '<?xml version=': 0, '>': 6, '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': '5168568', 'n_tokens_mistral': 724, 'n_tokens_neox': 683, 'n_words': 165}