Python run.run() Examples

The following are 5 code examples of run.run(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module run , or try the search function .
Example #1
Source File: test_case_job.py    From tcex with Apache License 2.0 6 votes vote down vote up
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 
Example #2
Source File: init.py    From product-recommender with MIT License 6 votes vote down vote up
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 
Example #3
Source File: test_case_job.py    From tcex with Apache License 2.0 5 votes vote down vote up
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 
Example #4
Source File: main.py    From mackrl with Apache License 2.0 5 votes vote down vote up
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() 
Example #5
Source File: main.py    From pymarl with Apache License 2.0 5 votes vote down vote up
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)