def main(): rec = recorder.Recorder() processorThread = processor.run(rec) rec.start() rec.record(5) rec.stop()
import manageFiles import processor import score import recommender processor.parameters['index'] = "codigo" processor.parameters['properties'] = ["desc","titulo","area_atuacao"] processor.parameters['new_path'] = reachrAPI.getJobToRecommend() processor.parameters['current_path'] = reachrAPI.getAllJobs() print(processor.parameters['new_path']) print(processor.parameters['current_path']) score.parameters['properties'] = ["desc","titulo","area_atuacao"] score.parameters['weights'] = {"desc":0.3, "titulo":0.6, "area_atuacao":0.1} score.parameters['input'] = processor.run() recommender.parameters['threshold'] = 0.2 recommender.parameters['selection-step'] = 2 recommender.parameters['key'] = processor.parameters['index'] recommender.parameters['inner-list'] = 'processo_seletivo' recommender.parameters['candidates-list'] = 'candidatos' recommender.parameters['input-jobs'] = manageFiles.read(processor.parameters['current_path']) recommender.parameters['input-similars'] = score.run() ret = reachrAPI.postJobRecommendation(recommender.run()) print(ret)
args = parser.parse_args() existed_video = [] # path_download = os.path.join(os.path.dirname(os.path.abspath(__file__)), args.download) # path_output = os.path.join(os.path.dirname(os.path.abspath(__file__)), args.out_folder) if not os.path.exists(args.download): os.makedirs(args.download) if not os.path.exists(args.out_folder): os.makedirs(args.out_folder) existed_video = os.listdir(args.out_folder) video_ids = crawling(args.keyword, args.num_video) video_ids = [x for x in video_ids if x not in existed_video] for video in video_ids: print(video) try: download(video, args.download) # 동영상 다운로드 except: continue run(args.download, args.accuracy, args.image_shape, args.out_folder, video, args.class_name) if os.path.exists(os.path.join(args.download, video + ".mp4")): os.remove(os.path.join(args.download, video + ".mp4")) #동영상 삭제
def spark_setup(): """ Sets configuration and creates Spark session """ conf = SparkConf() spark_context = SparkContext().getOrCreate(conf) spark_session = SparkSession(spark_context) spark_session.sparkContext.setLogLevel('WARN') return spark_session if __name__ == '__main__': parser = argparse.ArgumentParser(description='Input and output file names') parser.add_argument('student_file', help='the path to the file of student information') parser.add_argument('teacher_file', help='the path to the file of teacher information') parser.add_argument('--out', dest='output_file', help='the desired output path for the json report') input_args = parser.parse_args() print(input_args) spark = spark_setup() if input_args.output_file: processor.run(spark, input_args.student_file, input_args.teacher_file, input_args.output_file) else: processor.run(spark, input_args.student_file, input_args.teacher_file)
import processor import os import sys import traceback try: datadir = os.environ.get('KBC_DATADIR') or '/data/' processor.run(datadir) except ValueError as err: print(err, file=sys.stderr) sys.exit(1) except Exception as err: print(err, file=sys.stderr) traceback.print_exc(file=sys.stderr) sys.exit(2)
import sys import time import cProfile import memory import stack import streams import processor memory = memory.MemoryV1(sys.argv[1]) stack = stack.Stack() input = streams.KeyboardInputStreamV1() screen = streams.ScreenOutputStreamV1() transcript = streams.FileOutputStreamV1(time.strftime('%Y%m%d%H%M%S') + '.log') output = streams.OutputDemuxV1(screen, transcript, memory.get_header()) processor = processor.ProcessorV1(memory, stack, input, output) #profile = '' #cProfile.run(processor.run(), profile) processor.run() print 'Goodbye'
def test_run(): run(data_dir) assert out_file_exists("kml/kml-with-extended-data.csv") assert out_file_exists("shapefile/stations.csv") assert out_file_exists("geojson/stations.csv")
import setup setup.load() import manageFiles import processor import similarity root = '/home/mnf/reachr/projects/RecommenderSystem/test' processor.parameters['index'] = "codigo" processor.parameters['properties'] = ["desc", "titulo", "area_atuacao"] processor.parameters['current_path'] = root + "/support/vagas.json" processor.parameters['new_path'] = root + "/support/new_vaga.json" computed_similarity = processor.run() manageFiles.parameters['path'] = root + '/support/similiars.json' manageFiles.write(computed_similarity) #test jaccard import pandas as pd similarity.parameters['matrix'] = pd.DataFrame( [[1, 0, 1, 0, 1], [0, 0, 1, 1, 1]], columns=list('ABCDE')).transpose() print(similarity.run_jaccard())
def run(self): import processor # Imported here to avoid circular imports processor.run()
def listings(): loans = processor.run() return render_template("listings.html", loans=loans)