本文整理匯總了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)))