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


Python run.run方法代码示例

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


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

示例1: run

# 需要导入模块: import run [as 别名]
# 或者: from run import run [as 别名]
def run(self):
        """Run the Playbook App.

        Returns:
            int: The exit code fo the App.
        """
        from run import run

        # run the app
        exit_code = 0
        try:
            run()
        except SystemExit as e:
            exit_code = e.code

        self.log.data('run', 'Exit Code', exit_code)
        return exit_code 
开发者ID:ThreatConnect-Inc,项目名称:tcex,代码行数:19,代码来源:test_case_job.py

示例2: init

# 需要导入模块: import run [as 别名]
# 或者: from run import run [as 别名]
def init(nameList, productList, matrix):
    if isinstance(productList, int):
        products = m.mockProducts(productList)
    p.addProducts(products)
    if isinstance(nameList, int):
        nameList = m.mockCustomers(nameList)
    addCustomers(nameList)

    if isinstance(matrix, list):
        '''expected data: list of customers, list of products, list customer arrays containing 
        product purchases in same order as product list.'''
        dataBuilder(matrix);
    else:
        m.mockDataBuilder(names, products)
    c.matrixBuilder()

    recommend = run.run(names, matrix)
    while recommend == 'again':
        recommend = run.run(names, matrix)
    return recommend 
开发者ID:lramsey,项目名称:product-recommender,代码行数:22,代码来源:init.py

示例3: run_profile

# 需要导入模块: import run [as 别名]
# 或者: from run import run [as 别名]
def run_profile(self):
        """Run an App using the profile name."""
        self.create_shelf_dir(self.profile.tc_temp_path)

        # create encrypted config file
        self.create_config(self.profile.args)

        # run the service App in 1 of 3 ways
        if self.run_method == 'inline':
            # backup sys.argv
            sys_argv_orig = sys.argv

            # clear sys.argv
            sys.argv = sys.argv[:1]

            # run the App
            exit_code = self.run()

            # restore sys.argv
            sys.argv = sys_argv_orig
        elif self.run_method == 'subprocess':
            # run the Service App as a subprocess
            app_process = subprocess.Popen(['python', 'run.py'])
            exit_code = app_process.wait()

        # run the App
        return exit_code 
开发者ID:ThreatConnect-Inc,项目名称:tcex,代码行数:29,代码来源:test_case_job.py

示例4: my_main

# 需要导入模块: import run [as 别名]
# 或者: from run import run [as 别名]
def my_main(_run, _config, _log, env_args):
    global mongo_client

    # Setting the random seed throughout the modules
    np.random.seed(_config["seed"])
    th.manual_seed(_config["seed"])
    env_args['seed'] = _config["seed"]

    # run the framework
    run(_run, _config, _log, mongo_client)

    # force exit
    os._exit() 
开发者ID:schroederdewitt,项目名称:mackrl,代码行数:15,代码来源:main.py

示例5: my_main

# 需要导入模块: import run [as 别名]
# 或者: from run import run [as 别名]
def my_main(_run, _config, _log):
    # Setting the random seed throughout the modules
    config = config_copy(_config)
    np.random.seed(config["seed"])
    th.manual_seed(config["seed"])
    config['env_args']['seed'] = config["seed"]

    # run the framework
    run(_run, config, _log) 
开发者ID:oxwhirl,项目名称:pymarl,代码行数:11,代码来源:main.py


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