当前位置: 首页>>代码示例>>Python>>正文


Python Job.execute方法代码示例

本文整理汇总了Python中job.Job.execute方法的典型用法代码示例。如果您正苦于以下问题:Python Job.execute方法的具体用法?Python Job.execute怎么用?Python Job.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在job.Job的用法示例。


在下文中一共展示了Job.execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: search

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import execute [as 别名]
def search(query):
    job = Job(query) #use name prep from job init
    result = cache.get(job.hashtag)
    if not result:
        result = json.dumps(job.execute()) 
        cache.add(job.hashtag, result)
    return result
开发者ID:mzweilin,项目名称:HashTag-Understanding,代码行数:9,代码来源:server.py

示例2: execute_job

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import execute [as 别名]
	def execute_job(jobfile):
		j = Job(None)
		j.loadyaml(jobfile)
		if j.jobtype == "unittest":
			print "--------------------------------------------------"
			print "started test:\t" + j.name
			ret_status = j.execute()
			return j,ret_status
		else:
			return j, []
开发者ID:loraxman,项目名称:data_etl,代码行数:12,代码来源:testrunner.py

示例3: evaluate

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import execute [as 别名]
def evaluate():
    matrix = numpy.array(list(csv.reader(open("eval.csv","rb"),delimiter=','))).astype('string')
    retrieved = []

    for i in range(1,len(matrix)):
        hashtag = matrix[i][1]
        
        logger.info(hashtag)
        logger.info("expected urls: %s %s %s" % (matrix[i][3], matrix[i][4], matrix[i][5]))

        job  = Job(hashtag)
        urls = job.execute()
        
        url1Retrieved  = 0
        url2Retrieved = 0
        url3Retrieved = 0
        for url in urls:
            #print url
            if (url == matrix[i][3] ):
                url1Retrieved  = 1
            if (url == matrix[i][4] ):
                url2Retrieved  = 1
            if (url == matrix[i][5] ):
                url3Retrieved  = 1

        if (matrix[i][5] == ''):
            length = 2
        else:
            length = 3

        recall = float(url1Retrieved+url2Retrieved+url3Retrieved)/length
        # if url1Retrieved+url2Retrieved+url3Retrieved > 0:
        #     recall = 1
        # else:
        #     recall = 0
        logger.info("Recall of %s: %f" % (hashtag, recall))
        retrieved.append(recall)

    print retrieved
开发者ID:mzweilin,项目名称:HashTag-Understanding,代码行数:41,代码来源:evaluation.py


注:本文中的job.Job.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。