Function opens the run window
514704
def open_window(self, widget, data=None):
        
        if data is not None:
            self.kwargs = data.get('kwargs', None)
            self.top_assistant = data.get('top_assistant', None)
            self.current_main_assistant = data.get('current_main_assistant', None)
            self.debugging = data.get('debugging', False)
            if not self.debugging:
                self.debug_btn.set_label('Debug logs')
            else:
                self.debug_btn.set_label('Info logs')
        self.store.clear()
        self.debug_logs = dict()
        self.debug_logs['logs'] = list()
        self.thread = threading.Thread(target=self.dev_assistant_start)
        # We need only project name for github
        project_name = self.parent.path_window.get_data()[1]
        if self.kwargs.get('github'):
            self.link = self.gui_helper.create_link_button(
                "Link to project on Github",
                "http://www.github.com/{0}/{1}".format(self.kwargs.get('github'), project_name))
            self.link.set_border_width(6)
            self.link.set_sensitive(False)
            self.info_box.pack_start(self.link, False, False, 12)
        self.run_list_view.connect('size-allocate', self.list_view_changed)
        # We need to be in /home directory before each project creations
        os.chdir(os.path.expanduser('~'))
        self.run_window.show_all()
        self.disable_buttons()
        self.thread.start()
840124
function openFile(file) {
      var edit;
      if (!editor || gui) {
        open(file);
      } else {
        edit = spawn(editor, [file], {stdio: 'inherit'});
        edit.on('exit', process.exit);
      }
    }
178107
def _process_window(self, ji_win, func, **kwargs):
        
        arr = self.get_arrays(ji_win)
        result = func(arr, **kwargs)
        return result
1018147
function __runProgram() {
            try {
                eval(__program);
            } catch (err) {
                if (err.rethrow) throw(err);
                err = new Error(err.message+" in meta program of '"+__filename+"':\n"+__err2code(__program, err));
                err.rethrow = true;
                throw(err);
            }
        }
1330373
function run() {
	var len = series.length,
		ctx = context(),
		i = 0;

	series[ i ].call( ctx, next );

	function next() {
		i += 1;
		if ( i < len ) {
			series[ i ].call( ctx, next );
		}
	}
}
210315
def start(self, timeout=None):
        
        if not self._ioloop:
            raise RuntimeError('Call get_ioloop() or set_ioloop() first')

        self._ioloop.add_callback(self._running.set)

        if self._ioloop_managed:
            self._run_managed_ioloop()
        else:            #  TODO this seems inconsistent with what the docstring describes
            self._running.set()

        if timeout:
            return self._running.wait(timeout)
1203280
def run(self):
        """"""
        self.running = True
        while self.running:
            for fd, event in self.epoll.poll(self.epoll_timeout):
                callback = self.callbacks.get(fd)
                if callback:
                    callback()
767196
def run(self):
        
        self._connection = self.connect()
        self._connection.ioloop.start()
1000684
public function run(): void
    {
        // dynamicly parse input params
        $args = func_get_args();
        
        if (count($args) < 1) {
            return;
        }
        
        // get event name
        $eventName = array_shift($args);
        // get event args as array if passed
        $eventArgs = @array_shift($args);

        // if event is registered
        if (isset($this->events[$eventName]) && Any::isArray($this->events[$eventName])) {
            foreach ($this->events[$eventName] as $callback) {
                // call anonymous function with args if passed
                call_user_func_array($callback, $eventArgs);
            }
        }
        
        // set to post runned actions
        $this->runned[$eventName] = $eventArgs;
    }
9317
def main(argv=None):
    '''  '''
    parser = get_parser()

    # Parse arguments and run the function
    global args
    args = parser.parse_args(argv)
    args.func()
77915
def run(*args, &block)
      return Open3.popen3(*args, &block) if block_given?
      Open3.popen3(*args)
    end
597429
async function run () {
  if (options.help || Object.keys(options).length === 1) {
    showHelp()
    return
  }
  if (!options.name) {
    console.error('You need to input -n, --name argv')
    return
  }
  if (!options.title) {
    options.title = options.name.split('-').join(' ')
  }

  let content = (await fs.readFile(`${__dirname}/example.tpl`)).toString()
  content = content.replace(/@title@/, options.title || '')
    .replace(/@desc@/, options.desc || '')

  await fs.writeFile(`${__dirname}/../docs/examples/${options.name}.html`, content)
  console.info(`${options.name}.html`)

  let list = (await fs.readFile(`${__dirname}/../docs/_includes/example-list.md`)).toString()
  list += `<li><a href="../examples#${options.name}.html">${options.title}</a></li>\n`
  await fs.writeFile(`${__dirname}/../docs/_includes/example-list.md`, list)
}
1347771
function open() {
        // TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange
        // doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...
        _getInitialDocFromCurrent().done(function (doc) {
            var prepareServerPromise = (doc && _prepareServer(doc)) || new $.Deferred().reject(),
                otherDocumentsInWorkingFiles;

            if (doc && !doc._masterEditor) {
                otherDocumentsInWorkingFiles = MainViewManager.getWorkingSetSize(MainViewManager.ALL_PANES);
                MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, doc.file);

                if (!otherDocumentsInWorkingFiles) {
                    CommandManager.execute(Commands.CMD_OPEN, { fullPath: doc.file.fullPath });
                }
            }

            // wait for server (StaticServer, Base URL or file:)
            prepareServerPromise
                .done(function () {
                    _setStatus(STATUS_CONNECTING);
                    _doLaunchAfterServerReady(doc);
                })
                .fail(function () {
                    _showWrongDocError();
                });
        });
    }
1183598
def window(*args, &blk)
      win = Window.new self, extract_selector(args)

      win.use(&blk) if block_given?

      win
    end
148747
def run_open(state, module, *args, **kwargs):
    
    from ..core import which, ensure_project, inline_activate_virtual_environment

    # Ensure that virtualenv is available.
    ensure_project(
        three=state.three, python=state.python,
        validate=False, pypi_mirror=state.pypi_mirror,
    )
    c = delegator.run(
        '{0} -c "import {1}; print({1}.__file__);"'.format(which("python"), module)
    )
    try:
        assert c.return_code == 0
    except AssertionError:
        echo(crayons.red("Module not found!"))
        sys.exit(1)
    if "__init__.py" in c.out:
        p = os.path.dirname(c.out.strip().rstrip("cdo"))
    else:
        p = c.out.strip().rstrip("cdo")
    echo(crayons.normal("Opening {0!r} in your EDITOR.".format(p), bold=True))
    inline_activate_virtual_environment()
    edit(filename=p)
    return 0
131427
function completeOpen() {
      if (process.stdout.isTTY) {
        rl = readline.createInterface(process.stdin, process.stdout);
        rl.setPrompt(chalk.dim('TinyG# '), 'TinyG# '.length);
        rl.prompt();

        // WARNING WARNING WARNING -- using the internals of node readline!!
        //
        // We need to override the default behavior for a few keys.
        // So, we tell stdin to REMOVE all of the listeners to the 'keypress'
        // event, then we will be the only listener. If we don't have a special
        // behavior for the pressed key, then we pass it on to the readline.
        //
        // To avoid using internals too much, we'll snarf in the listeners,
        // store them away, and then call them ourselves.
        var old_keypress_listeners = process.stdin.listeners('keypress');

        process.stdin.removeAllListeners('keypress');
        process.stdin.on('keypress', function (ch, k) {
          if (k && k.ctrl) {
            if (k.name == 'd') {
              if (sendingFile) {
                log(util.format(">>^d\n"));
                g.write('\x04'); // send the ^d
              }
              return;
            }
            else if (k.name == 'c') {
              var e = util.format("## Received CTRL-C in State '%s' -- sending CTRL-D and exiting.\n", STAT_CODES[latestMotionStatus]);
              log(e);
              if (interactive) {
                process.stdout.write(chalk.dim(e));
              }

              tryToQuit()
              return;
            }

          // Single character commands get sent immediately
        } else if (ch && ch.match(/^[!~%]/)) {
            log(util.format(">>%s\n", ch));
            g.write(ch);
            return;
          }

          for (var i = 0; i < old_keypress_listeners.length; i++) {
            old_keypress_listeners[i](ch,k);
          }
        })

        rl.on('line', function(line) {
          parseCommand(line);
          if (rl !== null) {
            rl.prompt(true);
          }
        });

        rl.on('close', function() {
          g.close();
          rl = null;
        });

        var leftText = "Progress |";
        var rightText = "|   0% ";

        var status = {};

        g.on('statusChanged', function(st) {
          for(var prop in st) {
            status[prop] = st[prop];
          }

          if (status.stat) {
            latestMotionStatus = status.stat;
          }

          if (interactive) {
            readline.moveCursor(process.stdout, 0, -1);
            readline.clearLine(process.stdout, 0);

            process.stdout.write(
              sprintf("\rPos: X=%4.2f Y=%4.2f Z=%4.2f A=%4.2f Vel:%4.2f",
                status.posx||0,
                status.posy||0,
                status.posz||0,
                status.posa||0,
                status.vel||0
              )
            );
            if (status.he1t) {
              process.stdout.write(
                sprintf(" He1=%4.2fºC/%4.2fºC",
                  status.he1t||0,
                  status.he1st||0
                )
              );
            }
            process.stdout.write(
              sprintf(" (%s)\n",
                STAT_CODES[status.stat] || 'Stopped'
              )
            );

            if (!sendingFile) {
              process.stdout.write(
                JSON.stringify(status, null, 0) + "\n"
              );

              rl.prompt(true);
            }
          }


          if (st.line && sendingFile) {
            if (st.line > maxLineNumber) {
              maxLineNumber = st.line;
            }
            // clear the whole line.
            // readline.moveCursor(process.stdout, 0, -1);
            // readline.clearLine(process.stdout, 0);
            process.stdout.write("\r");

            var maxWidth = process.stdout.columns;
            var paddingWidth = leftText.length + rightText.length;
            var barWidth = (maxWidth - paddingWidth) * (st.line/maxLineNumber);
            var barLeft = (maxWidth - paddingWidth);

            process.stdout.write(leftText);
            // console.error("maxWidth: %d, paddingWidth: %d, sent: %d, lines: %d", maxWidth, paddingWidth, b.sent, b.lines);
            while (barWidth > 1.0) {
              process.stdout.write('=');
              barWidth = barWidth - 1.0;
              barLeft--;
            }
            if (barWidth > 0.6) {
              process.stdout.write('+');
              barLeft--;
            } else if (barWidth > 0.3) {
              process.stdout.write('-');
              barLeft--;
            }
            while (barLeft-- > 0) {
              process.stdout.write('_');
            }

            process.stdout.write("| ")
            var percent = ((st.line/maxLineNumber) * 100);
            process.stdout.write(sprintf("%3.0f%%", percent));

            // if (process.stderr.isTTY) {
            //   process.stdout.write("\n")
            // } else {
              process.stdout.write("\r")
            // }
          } // if st.line
          // rl.prompt(true);
        }); // g.on('statusChanged', ... )
      }

      if (args.gcode || !process.stdin.isTTY) {
        sendFile(args.gcode || process.stdin, true);
      }
    }
55193
def run(self):
        """"""
        ret = eventlet.spawn(self.context(self.func))
        eventlet.sleep(self.seconds)
        try:
            ret.wait()
        except Exception:  # pylint: disable=broad-except
            traceback.print_exc()
        self.thread = eventlet.spawn(self.run)