Execute compiled code.
499819
def execute(self, compiled=None, path=None, use_eval=False, allow_show=True):
        """"""
        self.check_runner()
        if compiled is not None:
            if allow_show and self.show:
                print(compiled)
            if path is not None:  # path means header is included, and thus encoding must be removed
                compiled = rem_encoding(compiled)
            self.runner.run(compiled, use_eval=use_eval, path=path, all_errors_exit=(path is not None))
            self.run_mypy(code=self.runner.was_run_code())
1106132
public final void execute() {
        try {
            Matcher<R> matcher = createMatcher();
            R result;
            if (input == null && timeout == null) {
                result = getExpect().expect(matcher);
            } else if (timeout == null) {
                result = getExpect().expectIn(input, matcher);
            } else if (input == null) {
                result = getExpect().expect(timeout, matcher);
            } else {
                result = getExpect().expectIn(input, timeout, matcher);
            }
            exportSuccessfulResult(resultPrefix, result);
        } catch (IOException e) {
            throw new BuildException(e);
        }
    }
860652
def execute(self, fn, *args, **kwargs):
        """"""
        if not self.asynchronous:
            return fn(*args, **kwargs)
        raise NotImplementedError
809255
public void execute() {
        try {
            final IntermediateModel intermediateModel =
                    new IntermediateModelBuilder(models, codeGenBinDirectory).build();

            // Dump the intermediate model to a file
            writeIntermediateModel(intermediateModel);

            emitCode(intermediateModel);

        } catch (Exception e) {
            throw new RuntimeException(
                    "Failed to generate code. Exception message : "
                    + e.getMessage(), e);

        }
    }
1018832
def run(self, *args):
        """"""

        params = self.parser.parse_args(args)

        code = self.show(params.uuid, params.term)

        return code
1221127
def _execute(self):
        """"""

        query = [
            'gerrit', 'query',
            '--current-patch-set',
            str(self._filters),
            '--format=JSON']

        results = self.client.exec_command(' '.join(query))
        stdin, stdout, stderr = results

        for line in stdout:
            normalized = json.loads(line)

            # Do not return the last item
            # since it is the summary of
            # of the query
            if "rowCount" in normalized:
                raise StopIteration

            yield normalized
995595
def execute_command(command=None):
    """"""
    process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout, stdin = process.communicate()
    process.wait()
    return (stdout, stdin), process.returncode
839767
def execute(self, program, start=None, stop=None, resolution=None,
                max_delay=None, persistent=False, immediate=False,
                disable_all_metric_publishes=None):
        """"""
        params = self._get_params(start=start, stop=stop,
                                  resolution=resolution,
                                  maxDelay=max_delay,
                                  persistent=persistent,
                                  immediate=immediate,
                                  disableAllMetricPublishes=disable_all_metric_publishes)

        def exec_fn(since=None):
            if since:
                params['start'] = since
            return self._transport.execute(program, params)

        c = computation.Computation(exec_fn)
        self._computations.add(c)
        return c
36715
public function execute()
    {
        global $theme, $app_mode;

        extract(psa(array(
            'type',
            'code',
        )));

        $js = array();
        $msg = gTxt('rah_terminal_success');

        if (!isset($this->terminals[$type])) {
            $msg = array(gTxt('rah_terminal_unknown_type'), E_WARNING);
        } elseif (trim($code) === '') {
            $msg = array(gTxt('rah_terminal_code_required'), E_WARNING);
        } else {
            set_pref('rah_terminal_last_type', $type, 'rah_terminal', PREF_HIDDEN, '', 0, PREF_PRIVATE);

            try {
                ob_start();
                @error_reporting(-1);
                @set_error_handler(array($this, 'error'));
                $starting_memory = memory_get_usage();
                $runtime = getmicrotime();
                @$direct = call_user_func($this->terminals[$type], $code);
                $runtime = rtrim(number_format(getmicrotime() - $runtime, 15, '.', ''), 0);
                $total_memory = memory_get_usage();
                $memory = max(0, $total_memory - $starting_memory);
                restore_error_handler();
                $buffer = ob_get_clean();
            } catch (Exception $e) {
                $this->error[] = $e->getMessage();
            }

            if ($this->error) {
                $msg = array(gTxt('rah_terminal_error'), E_ERROR);
            } elseif ($direct === false && $buffer === '') {
                $msg = array(gTxt('rah_terminal_blackhole'), E_WARNING);
            }

            if ($buffer !== ' ' && $direct === NULL) {
                $direct = trim($buffer);
            }

            $stamp = gTxt('rah_terminal_said_by', array(
                '{time}' => safe_strftime(gTxt('rah_terminal_timestamp')),
                '{user}' => $this->userstamp,
            ));

            if ($this->type === NULL) {
                $this->type = gettype($direct);
            }

            $notes = 
                gTxt('rah_terminal_notes', array(
                    '{runtime}' => $runtime,
                    '{type}' => $this->type,
                    '{notes}' => implode(' ', $this->notes),
                    '{memory}' => $memory,
                ));

            if ($this->postHook) {
                $js[] = call_user_func($this->postHook, $direct);
            }

            $direct = htmlspecialchars($this->getSafeValue($direct));
            $errors = array();

            foreach ($this->error as $error) {
                $errors[] = '<span>'.htmlspecialchars($error).'</span>';
            }

            $errors = $errors ? '<p class="rah_terminal_errors error">' . implode('<br />', $errors) . '</p>' : '';

            $code = 
                '<div class="rah_terminal_result">'.
                    '<p>'.$stamp.' <a class="rah_terminal_result_close" href="#">'.gTxt('rah_terminal_close').'</a></p>'.
                    '<pre><code>'.$direct.'</code></pre>'.
                    $errors.
                    '<p class="rah_terminal_note">'.$notes.'</p>'.
                '</div>';

            $js[] = "$('#rah_terminal_container').after('".escape_js($code)."');";
        }

        if ($app_mode == 'async') {
            send_script_response(implode(n, $js) . $theme->announce_async($msg));
            return;
        }

        $this->form($msg);
        echo $code;
    }
1290270
def run():
    """"""
    args = parse()
    build_results = [build(p) for p in glob.iglob(glob_path)]

    if not args['publish']:
        return

    for entry in build_results:
        publish(entry)
712329
def run(self, cmd, fn=None, globals=None, locals=None):
        """"""
        if globals is None:
            import __main__
            globals = __main__.__dict__
        if locals is None:
            locals = globals
        self.reset()
        if isinstance(cmd, str):
            str_cmd = cmd
            cmd = compile(str_cmd, fn or "<wdb>", "exec")
            self.compile_cache[id(cmd)] = str_cmd
        if fn:
            from linecache import getline
            lno = 1
            while True:
                line = getline(fn, lno, globals)
                if line is None:
                    lno = None
                    break
                if executable_line(line):
                    break
                lno += 1

        self.start_trace()
        if lno is not None:
            self.breakpoints.add(LineBreakpoint(fn, lno, temporary=True))
        try:
            execute(cmd, globals, locals)
        finally:
            self.stop_trace()
43011
def execute(self, proxy, method, args):
        """"""
        try:
            result = getattr(proxy, method)(raw_xml=self.options.xml, *tuple(args))
        except xmlrpc.ERRORS as exc:
            self.LOG.error("While calling %s(%s): %s" % (method, ", ".join(repr(i) for i in args), exc))
            self.return_code = error.EX_NOINPUT if "not find" in getattr(exc, "faultString", "") else error.EX_DATAERR
        else:
            if not self.options.quiet:
                if self.options.repr:
                    # Pretty-print if requested, or it's a collection and not a scalar
                    result = pformat(result)
                elif hasattr(result, "__iter__"):
                    result = '\n'.join(i if isinstance(i, basestring) else pformat(i) for i in result)
                print(fmt.to_console(result))
714564
def run(ctx, args):
    """"""
    if not args:
        click.echo(ctx.get_help())
        return

    with chdir(get_root()):
        result = run_command(args)

    ctx.exit(result.code)
445900
def run(self, *args):
        """"""

        params = self.parser.parse_args(args)

        code = self.add(params.source, params.email, params.name, params.username,
                        params.uuid, params.matching, params.interactive)

        return code
1099466
@SuppressWarnings("unchecked")
    public void execute()
        throws MojoExecutionException, CompilationFailureException
    {
        // ----------------------------------------------------------------------
        // Look up the compiler. This is done before other code than can
        // cause the mojo to return before the lookup is done possibly resulting
        // in misconfigured POMs still building.
        // ----------------------------------------------------------------------

        Compiler compiler;

        getLog().debug( "Using compiler '" + compilerId + "'." );

        try
        {
            compiler = compilerManager.getCompiler( compilerId );
        }
        catch ( NoSuchCompilerException e )
        {
            throw new MojoExecutionException( "No such compiler '" + e.getCompilerId() + "'." );
        }

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        List compileSourceRoots = removeEmptyCompileSourceRoots( getCompileSourceRoots() );

        if ( compileSourceRoots.isEmpty() )
        {
            getLog().info( "No sources to compile" );

            return;
        }

        if ( getLog().isDebugEnabled() )
        {
            getLog().debug( "Source directories: " + compileSourceRoots.toString().replace( ',', '\n' ) );
            getLog().debug( "Classpath: " + getClasspathElements().toString().replace( ',', '\n' ) );
            getLog().debug( "Output directory: " + getOutputDirectory() );
        }

        // ----------------------------------------------------------------------
        // Create the compiler configuration
        // ----------------------------------------------------------------------

        CompilerConfiguration compilerConfiguration = new CompilerConfiguration();

        compilerConfiguration.setOutputLocation( getOutputDirectory().getAbsolutePath() );

        compilerConfiguration.setClasspathEntries( getClasspathElements() );

        compilerConfiguration.setSourceLocations( compileSourceRoots );

        compilerConfiguration.setOptimize( optimize );

        compilerConfiguration.setDebug( debug );

        compilerConfiguration.setVerbose( verbose );

        compilerConfiguration.setShowWarnings( showWarnings );

        compilerConfiguration.setShowDeprecation( showDeprecation );

        compilerConfiguration.setSourceVersion( source );

        compilerConfiguration.setTargetVersion( target );

        compilerConfiguration.setSourceEncoding( encoding );

        if ( compilerArguments != null )
        {
            LinkedHashMap cplrArgsCopy = new LinkedHashMap();
            for (Object o : compilerArguments.entrySet()) {
                Map.Entry me = (Map.Entry) o;
                String key = (String) me.getKey();
                if (!key.startsWith("-")) {
                    key = "-" + key;
                }
                cplrArgsCopy.put(key, me.getValue());
            }
            compilerConfiguration.setCustomCompilerArguments( cplrArgsCopy );
        }

        compilerConfiguration.setFork( fork );

        compilerConfiguration.setExecutable( executable );

        compilerConfiguration.setWorkingDirectory( basedir );

        compilerConfiguration.setCompilerVersion( compilerVersion );

        compilerConfiguration.setBuildDirectory( buildDirectory );

        compilerConfiguration.setOutputFileName( outputFileName );

        Set staleSources;

        boolean canUpdateTarget;

        try
        {
            staleSources =
                computeStaleSources( compilerConfiguration, compiler, getSourceInclusionScanner( staleMillis ) );

            canUpdateTarget = compiler.canUpdateTarget( compilerConfiguration );

            if ( compiler.getCompilerOutputStyle().equals( CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES ) &&
                !canUpdateTarget )
            {
                getLog().info( "RESCANNING!" );
                String inputFileEnding = compiler.getInputFileEnding( compilerConfiguration );

                Set sources = computeStaleSources( compilerConfiguration, compiler,
                                                   getSourceInclusionScanner( inputFileEnding ) );

                compilerConfiguration.setSourceFiles( sources );
            }
            else
            {
                compilerConfiguration.setSourceFiles( staleSources );
            }
        }
        catch ( CompilerException e )
        {
            throw new MojoExecutionException( "Error while computing stale sources.", e );
        }

        if ( staleSources.isEmpty() )
        {
            getLog().info( "Nothing to compile - all classes are up to date" );

            return;
        }

        // ----------------------------------------------------------------------
        // Dump configuration
        // ----------------------------------------------------------------------

        if ( getLog().isDebugEnabled() )
        {
            getLog().debug( "Classpath:" );

            for (Object o : getClasspathElements()) {
                String s = (String) o;

                getLog().debug(" " + s);
            }

            getLog().debug( "Source roots:" );

            for (Object o : getCompileSourceRoots()) {
                String root = (String) o;

                getLog().debug(" " + root);
            }

            if ( fork )
            {
                try
                {
                    String[] cl = compiler.createCommandLine( compilerConfiguration );
                    if ( cl != null && cl.length > 0 )
                    {
                        StringBuffer sb = new StringBuffer();
                        sb.append( cl[0] );
                        for ( int i = 1; i < cl.length; i++ )
                        {
                            sb.append( " " );
                            sb.append( cl[i] );
                        }
                        getLog().debug( "Command line options:" );
                        getLog().debug( sb );
                    }
                }
                catch ( CompilerException ce )
                {
                    getLog().debug( ce );
                }
            }
        }

        // ----------------------------------------------------------------------
        // Compile!
        // ----------------------------------------------------------------------

        List<CompilerError> messages;

        try
        {
            messages = compiler.compile( compilerConfiguration );
        }
        catch ( Exception e )
        {
            throw new MojoExecutionException( "Fatal error compiling", e );
        }

        boolean compilationError = false;

        for ( CompilerError message : messages)
        {
            if ( message.isError() )
            {
                compilationError = true;
            }
        }

        if ( compilationError )
        {
            throw new CompilationFailureException( messages );
        }
        else
        {
            for (CompilerError message : messages) {
                getLog().warn(message.toString());
            }
        }
    }
534718
def execute_code_block(compiler, block, example_globals,
                       script_vars, gallery_conf):
    """"""
    blabel, bcontent, lineno = block
    # If example is not suitable to run, skip executing its blocks
    if not script_vars['execute_script'] or blabel == 'text':
        script_vars['memory_delta'].append(0)
        return ''

    cwd = os.getcwd()
    # Redirect output to stdout and
    orig_stdout = sys.stdout
    src_file = script_vars['src_file']

    # First cd in the original example dir, so that any file
    # created by the example get created in this directory

    my_stdout = MixedEncodingStringIO()
    os.chdir(os.path.dirname(src_file))

    sys_path = copy.deepcopy(sys.path)
    sys.path.append(os.getcwd())
    sys.stdout = LoggingTee(my_stdout, logger, src_file)

    try:
        dont_inherit = 1
        code_ast = compile(bcontent, src_file, 'exec',
                           ast.PyCF_ONLY_AST | compiler.flags, dont_inherit)
        ast.increment_lineno(code_ast, lineno - 1)
        # don't use unicode_literals at the top of this file or you get
        # nasty errors here on Py2.7
        _, mem = _memory_usage(_exec_once(
            compiler(code_ast, src_file, 'exec'), example_globals),
            gallery_conf)
    except Exception:
        sys.stdout.flush()
        sys.stdout = orig_stdout
        except_rst = handle_exception(sys.exc_info(), src_file, script_vars,
                                      gallery_conf)
        # python2.7: Code was read in bytes needs decoding to utf-8
        # unless future unicode_literals is imported in source which
        # make ast output unicode strings
        if hasattr(except_rst, 'decode') and not \
                isinstance(except_rst, unicode):
            except_rst = except_rst.decode('utf-8')

        code_output = u"\n{0}\n\n\n\n".format(except_rst)
        # still call this even though we won't use the images so that
        # figures are closed
        save_figures(block, script_vars, gallery_conf)
        mem = 0
    else:
        sys.stdout.flush()
        sys.stdout = orig_stdout
        sys.path = sys_path
        os.chdir(cwd)

        my_stdout = my_stdout.getvalue().strip().expandtabs()
        if my_stdout:
            stdout = CODE_OUTPUT.format(indent(my_stdout, u' ' * 4))
        else:
            stdout = ''
        images_rst = save_figures(block, script_vars, gallery_conf)
        code_output = u"\n{0}\n\n{1}\n\n".format(images_rst, stdout)

    finally:
        os.chdir(cwd)
        sys.path = sys_path
        sys.stdout = orig_stdout
    script_vars['memory_delta'].append(mem)

    return code_output
129057
def run(self):
    """"""
    compiler = new_compiler(compiler=self.compiler)
    if compiler.compiler_type == "msvc":
      self.define = [
          ("UNICODE", ""),
      ]

    else:
      command = "sh configure --disable-shared-libs"
      output = self._RunCommand(command)

      print_line = False
      for line in output.split("\n"):
        line = line.rstrip()
        if line == "configure:":
          print_line = True

        if print_line:
          print(line)

      self.define = [
          ("HAVE_CONFIG_H", ""),
          ("LOCALEDIR", "\"/usr/share/locale\""),
      ]

    build_ext.run(self)