def run(): print("Creating whole project") index.run() e404.run() timeline.run() contestants.run() search.run() static_files.run()
def run(): print("Creating the whole project") index.run() e404.run() timeline.run() countries.run() search.run() static_files.run()
def run(): print("Creating whole project") index.run() e404.run() timeline.run() countries.run() search.run() static_files.run() backward_compatibility.run()
def main(): logging.basicConfig(filename='module.log', format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO) gli.run(EnablePorterStemmer=True) index.run() busca.run(EnablePorterStemmer=True) pc.run()
def test_index_run(self): run([ '', '--input=small_test.txt', '--start=foo', '--stop=bar', '--finish=007', '-s', f'--output={file_name}', ]) res = '{\n "cow": 2,\n "siamese": 1,\n "wonderland": 1,\n "foo": 1,\n "toothpaste": 1,\n "milky": 1,\n "flight-manual": 1,\n "toothpick": 1\n}' with open(file_name, 'r') as file: contents = file.read() self.assertEqual(res, contents)
def test_index_run_csv(self): run([ '', '--input=small_test.txt', '--start=foo', '--stop=bar', '--finish=007', '-s', f'--output={file_name_csv}', '-c', ]) res = 'Name,Count\ncow,2\nsiamese,1\nwonderland,1\nfoo,1\ntoothpaste,1\nmilky,1\nflight-manual,1\ntoothpick,1\n' with open(file_name_csv, 'r') as file: contents = file.read() self.assertEqual(res, contents)
def test_index_run_twice(self): res = [ ('cow', 'cow', 0), ('cow', 'cow', 0), ('siamese', 'siamese', 0), ('wonderland', 'wonderland', 0), ('foo', 'foo', 0), ('toothpaste', 'toothpaste', 0), ('milky', 'milky', 0), ('flight-manual', 'flight-manual', 0), ('toothpick', 'toothpick', 0), ('cow', 'cow', 0), ('cow', 'cow', 0), ('siamese', 'siamese', 0), ('wonderland', 'wonderland', 0), ('foo', 'foo', 0), ('toothpaste', 'toothpaste', 0), ('milky', 'milky', 0), ('flight-manual', 'flight-manual', 0), ('toothpick', 'toothpick', 0), ] run([ '', '--input=small_test.txt', '--start=foo', '--stop=bar', '--finish=007', ], db_name, table_name) # run a second time run([ '', '--input=small_test.txt', '--start=foo', '--stop=bar', '--finish=007', ], db_name, table_name) conn = connect_db(db_name, table_name) cur = conn.cursor() cur.execute(f"SELECT word, word2, relation FROM {table_name}") result = cur.fetchall() close_db(conn) self.assertEqual(result, res)
def getGenre(self,filename): filename = self.find(filename,'../../Dataset') # print filename out = run('nn',filename) if out[0][0] == 1: print 'classical' elif out[0][1] == 1: print 'pop' elif out[0][2] == 1: print 'jazz' elif out[0][3] == 1: print 'metal'
def run(): index.run()
def getReco(self,filename,genre): print run('reco',filename,genre)
def index_page(): return index.run()
import index index.run(4)
def main(): data = rd.loadData() dataIndex = index.run(data) loop(data, dataIndex)