Run a Forest ``run`` job on a QVM.

        Users should use :py:func:`QVM.run` instead of calling this directly.
971960
def _qvm_run(self, quil_program, classical_addresses, trials,
                 measurement_noise, gate_noise, random_seed) -> np.ndarray:
        
        payload = qvm_run_payload(quil_program, classical_addresses, trials,
                                  measurement_noise, gate_noise, random_seed)
        response = post_json(self.session, self.sync_endpoint + "/qvm", payload)

        ram = response.json()

        for k in ram.keys():
            ram[k] = np.array(ram[k])

        return ram
183034
def runner(Options, buffering=True):
    
    def run(argv=None):
        if not buffering:
            sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
            sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)

        if argv is None:
            argv = sys.argv
        o = Options()
        try:
            o.parseOptions(argv[1:])
        except usage.UsageError, e:
            if hasattr(o, 'subOptions'):
                print str(o.subOptions)
            else:
                print str(o)
            print str(e)
            return 1

        return 0

    return run
1347115
def run(self, **kwargs):
    
    env, kwargs = self._prepare_env(kwargs)
    logger.debug('Running command {}'.format(self.cmd))
    return subprocess.Popen(self.cmd, env=env, **kwargs)
149849
def run(self, xml, **kwargs):
        
        kwargs['output'] = self.__graph__()
        if isinstance(xml, str):
            try:
                self.source = etree.XML(xml)
            except ValueError:
                try:
                    self.source = etree.XML(xml.encode())
                except:
                    raise ValueError("Cannot run error {}".format(sys.exc_info()[0]))
        else:
            self.source = xml
        super(XMLProcessor, self).run(**kwargs)
        self.output = kwargs['output']
        return kwargs['output']
745757
def run(self):
        
        try:
            quit_request_detected = False
            while True:
                function, arguments = self.task_queue.get()
                if function is None:
                    # this allows us to watch the threads die and identify
                    # threads that may be hanging or deadlocked
                    self.config.logger.info('quits')
                    break
                if quit_request_detected:
                    continue
                try:
                    try:
                        args, kwargs = arguments
                    except ValueError:
                        args = arguments
                        kwargs = {}
                    function(*args, **kwargs)  # execute the task
                except Exception:
                    self.config.logger.error("Error in processing a job",
                                             exc_info=True)
                except KeyboardInterrupt:  # TODO: can probably go away
                    self.config.logger.info('quit request detected')
                    quit_request_detected = True
                    #thread.interrupt_main()  # only needed if signal handler
                                             # not registered
        except Exception:
            self.config.logger.critical("Failure in task_queue", exc_info=True)
580500
def run_tree (tree, g, l):
    """"""
    runner= Ayrton (g=g, l=l)
    return runner.run_tree (tree, 'unknown_tree')
69088
def run_app(self):
        """"""
        # Update system arguments
        sys.argv[0] = sys.executable
        sys.argv[1] = '{}.py'.format(sys.argv[1])

        # Make sure to exit with the return value from the subprocess call
        self._app_process = subprocess.Popen(sys.argv)
        return self._app_process.wait()
1005943
def run(self, **kwargs):
        
        if not (self.input and self.output and self.exe):
            raise RuntimeError("setup incomplete, can't run")
        self.logger.info("running MapReduce application")
        run_pipes(self.exe, self.input, self.output, **kwargs)
944966
def run(self, cmd):
        
        # TODO: can this be removed ?
        import __main__
        main_dict = __main__.__dict__
        return self.runctx(cmd, main_dict, main_dict)
1174569
def _run(self):
        """"""
        self.set_state(self.STATE_INITIALIZING)
        self.ioloop = ioloop.IOLoop.current()
        self.consumer_lock = locks.Lock()

        self.sentry_client = self.setup_sentry(
            self._kwargs['config'], self.consumer_name)

        try:
            self.setup()
        except (AttributeError, ImportError):
            return self.on_startup_error(
                'Failed to import the Python module for {}'.format(
                    self.consumer_name))

        if not self.is_stopped:
            try:
                self.ioloop.start()
            except KeyboardInterrupt:
                LOGGER.warning('CTRL-C while waiting for clean shutdown')
69921
def run():
    
    plugin_list = load_plugins()

    module = sys.modules['__main__']
    plugin_list.insert(0, ObjectSupplier(module))

    return run_with_plugins(plugin_list)
379122
def run_job(self, **kwds):
        
        template = DrmaaSession.session.createJobTemplate()
        try:
            for key in kwds:
                setattr(template, key, kwds[key])
            with DrmaaSession.session_lock:
                return DrmaaSession.session.runJob(template)
        finally:
            DrmaaSession.session.deleteJobTemplate(template)
369508
def run(self):
        
        run_command = (
            settings.project_customization.runfile.read_text().split()
        )
        chmod_string = (
            "chmod +x "
            + settings.project_customization.runfile.absolute().as_posix()
        )
        subprocess.run(chmod_string.split())
        subprocess.run(
            run_command, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr
        )
714319
def run(app, argv=sys.argv, extra_args=None):
    
    if app not in argv[:2]:
        # app is automatically added if not present
        argv.insert(1, app)
    if len(argv) < 3 and 'test' not in argv[:2]:
        # test argument is given if not argument is passed
        argv.insert(2, 'test')
    if extra_args:
        argv.extend(extra_args)
    return runner(argv)
574635
def run(self, args=(), env={}):
        

        # the following will call self._get_exec_binary
        return self._exec(self.binary, args=args, env=env)
1373186
def run(self):
        
        while True:
            path, params = self.path_queue.get()
            errors = run(path, **params)
            self.result_queue.put(errors)
            self.path_queue.task_done()
918432
def run_locally(self, steps=None, **kwargs):
        """"""
        self.slurm_job = LoggedJobSLURM(self.command(steps),
                                        base_dir = self.parent.p.logs_dir,
                                        modules  = self.modules,
                                        **kwargs)
        self.slurm_job.run_locally()