本文整理汇总了Python中context.Context方法的典型用法代码示例。如果您正苦于以下问题:Python context.Context方法的具体用法?Python context.Context怎么用?Python context.Context使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类context
的用法示例。
在下文中一共展示了context.Context方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete_item
# 需要导入模块: import context [as 别名]
# 或者: from context import Context [as 别名]
def delete_item():
''' Delete keymap action.
'''
import context
context.Context(delete=True)
示例2: function_context
# 需要导入模块: import context [as 别名]
# 或者: from context import Context [as 别名]
def function_context(request, get_k8s_custom_obj_client, api_instance, minio_resource,
minio_client):
context = Context(k8s_client=api_instance, k8s_client_custom=get_k8s_custom_obj_client,
minio_resource_client=minio_resource, minio_client=minio_client)
request.addfinalizer(context.delete_all_objects)
return context
示例3: session_context
# 需要导入模块: import context [as 别名]
# 或者: from context import Context [as 别名]
def session_context(request, get_k8s_custom_obj_client, api_instance, minio_resource, minio_client):
context = Context(k8s_client=api_instance, k8s_client_custom=get_k8s_custom_obj_client,
minio_resource_client=minio_resource, minio_client=minio_client)
request.addfinalizer(context.delete_all_objects)
return context
示例4: ELF64_R_SYM
# 需要导入模块: import context [as 别名]
# 或者: from context import Context [as 别名]
def ELF64_R_SYM(val):
return (val) >> 32
#Globals: If there end up being too many of these, put them in a Context & pass them around
示例5: __init__
# 需要导入模块: import context [as 别名]
# 或者: from context import Context [as 别名]
def __init__(self,write_so,exec_only,no_pic):
self.context = Context()
self.context.write_so = write_so
self.context.exec_only = exec_only
self.context.no_pic = no_pic
示例6: generate_context
# 需要导入模块: import context [as 别名]
# 或者: from context import Context [as 别名]
def generate_context(self):
return nufhe.Context()
示例7: run
# 需要导入模块: import context [as 别名]
# 或者: from context import Context [as 别名]
def run(unknown_arguments=False):
for file in [config.ticks_csv, config.network_csv, config.nodes_csv]:
utils.check_for_file(file)
parser = _create_parser()
if unknown_arguments:
args = parser.parse_known_args(sys.argv[2:])[0]
else:
args = parser.parse_args(sys.argv[2:])
logging.info("Parsed arguments in {}: {}".format(__name__, args))
utils.update_args(args)
_check_skip_ticks(args.skip_ticks)
context = Context()
logging.info(config.log_line_run_start + context.run_name)
tag = context.args.tag
if hasattr(context.args, 'tag_appendix'):
tag += context.args.tag_appendix
writer = Writer(tag)
runner = Runner(context, writer)
prepare = Prepare(context)
runner._prepare = prepare
postprocessing = PostProcessing(context, writer)
runner._postprocessing = postprocessing
event = Event(context)
runner._event = event
start = time.time()
runner.run()
logging.info("The duration of the run was {} seconds".format(str(time.time() - start)))