當前位置: 首頁>>代碼示例>>Python>>正文


Python context.Context方法代碼示例

本文整理匯總了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) 
開發者ID:MediaBrowser,項目名稱:plugin.video.emby,代碼行數:9,代碼來源:default.py

示例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 
開發者ID:IntelAI,項目名稱:inference-model-manager,代碼行數:8,代碼來源:conftest.py

示例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 
開發者ID:IntelAI,項目名稱:inference-model-manager,代碼行數:7,代碼來源:conftest.py

示例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 
開發者ID:utds3lab,項目名稱:multiverse,代碼行數:6,代碼來源:multiverse.py

示例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 
開發者ID:utds3lab,項目名稱:multiverse,代碼行數:7,代碼來源:multiverse.py

示例6: generate_context

# 需要導入模塊: import context [as 別名]
# 或者: from context import Context [as 別名]
def generate_context(self):
        return nufhe.Context() 
開發者ID:f-prime,項目名稱:arcanevm,代碼行數:4,代碼來源:NUFHEContext.py

示例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))) 
開發者ID:sbaresearch,項目名稱:simcoin,代碼行數:40,代碼來源:simulation_cmd.py


注:本文中的context.Context方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。