Present the PTY of the container inside the current process.

    This is just a wrapper for PseudoTerminal(client, container).start()
486754
def start(client, container, interactive=True, stdout=None, stderr=None, stdin=None, logs=None):
    

    operation = RunOperation(client, container, interactive=interactive, stdout=stdout,
                             stderr=stderr, stdin=stdin, logs=logs)

    PseudoTerminal(client, operation).start()
1318057
def startReq(self, key, contract=None, container=None):
        
        future = asyncio.Future()
        self._futures[key] = future
        self._results[key] = container if container is not None else []
        if contract:
            self._reqId2Contract[key] = contract
        return future
560058
def init_and_start(self, taskParent, override={}):
        
        tag = self.initialize(taskParent, override=override)
        self.start()

        return tag
851550
def _start_aux(self):
        

        # We can not use the API because docker doesn't expose a websocket api for exec
        # https://github.com/GNS3/gns3-gui/issues/1039
        process = yield from asyncio.subprocess.create_subprocess_exec(
            "docker", "exec", "-i", self._cid, "/gns3/bin/busybox", "script", "-qfc", "while true; do TERM=vt100 /gns3/bin/busybox sh; done", "/dev/null",
            stdout=asyncio.subprocess.PIPE,
            stderr=asyncio.subprocess.STDOUT,
            stdin=asyncio.subprocess.PIPE)
        server = AsyncioTelnetServer(reader=process.stdout, writer=process.stdin, binary=True, echo=True)
        self._telnet_servers.append((yield from asyncio.start_server(server.run, self._manager.port_manager.console_host, self.aux)))
        log.debug("Docker container '%s' started listen for auxilary telnet on %d", self.name, self.aux)
1080883
function startPhantom (specPath, cfg, cb) {
        var args = [specPath];
        if (cfg.verbose) {
            args.push("--verbose"); // custom, to be handled by spec runner
        }
        if (cfg.debug) {
            args.push("--debug"); // custom, to be handled by spec runner
        }
        if (cfg.color) {
            args.push("--color"); // custom, to be handled by spec runner
        }
        args.push("--xunitName=" + cfg.xunitName);
        var phantomProcess = grunt.util.spawn({
            cmd : 'phantomjs',
            args : args
        }, cb);

        phantomProcess.stdout.pipe(process.stdout);
        phantomProcess.stderr.pipe(process.stderr);
        return phantomProcess;
    }
409393
def run_pty(self, command):
        
        boto.log.debug('running:%s on %s' % (command, self.server.instance_id))
        channel = self._ssh_client.get_transport().open_session()
        channel.get_pty()
        channel.exec_command(command)
        return channel.recv(1024)
1312224
def processes
      raise ContainerError, "Container is not running" if !running?

      str = run("ps", "--", "-eo pid,user,%cpu,%mem,args").strip
      lines = str.split("\n") ; lines.delete_at(0)
      lines.map { |l| parse_process_line(l) }
    end
435881
def _container_start_handler(ion_type, length, ctx):
    """"""
    _, self = yield

    container_ctx = ctx.derive_container_context(length)
    if ctx.annotations and ctx.limit != container_ctx.limit:
        # 'ctx' is the annotation wrapper context. `container_ctx` represents the wrapper's 'value' subfield. Their
        # limits must match.
        raise IonException('Incorrect annotation wrapper length.')
    delegate = _container_handler(ion_type, container_ctx)

    # We start the container, and transition to the new container processor.
    yield ctx.event_transition(
        IonEvent, IonEventType.CONTAINER_START, ion_type, value=None, whence=delegate
    )
1217124
def run(self):
        
        luigi.LocalTarget(path=self.fixture).copy(self.output().path)
325712
function(context, node, args, container) {
		if (context.env.data.isServer)
			return;
		args[0].toDOM(node, context, container);
	}
1174468
def run(self):
        
        setproctitle.setproctitle("{:s}: {:s}".format(
            self.context.config.name, self.__class__.__name__))
        self.logger.info(
            "Worker '%s' has been started with pid %d",
            self.__class__.__name__, os.getpid())

        # Register SIGINT handler which will exit service process
        def sigint_handler(unused_signum, unused_frame):
            """
            Exit service process when SIGINT is reached.
            """
            self.stop()
        signal.signal(signal.SIGINT, sigint_handler)

        # Initialize logging
        self.context.config.configure_logging()
        # Initialize child
        self.context.initialize_child(SERVICE_PROCESS, process=self)

        next_loop_time = 0
        while 1:
            # Exit if pid of the parent process has changed (parent process
            # has exited and init is new parent) or if stop flag is set.
            if os.getppid() != self._parent_pid or self._stop_event.is_set():
                break
            # Repeatedly call loop method. After first call set ready flag.
            if time.time() >= next_loop_time:
                try:
                    self.loop()
                except Exception:
                    self.logger.exception(
                        "Worker '%s' failed", self.__class__.__name__)
                else:
                    if not next_loop_time and not self.ready:
                        self._ready.value = True
                next_loop_time = time.time() + self.interval
            else:
                time.sleep(0.25)
385011
@NotNull
	@Override
	public final MaterializedPromise<Void> startProcess() {
		if (!processStarted) {
			processStarted = true;
			beforeProcess();
			doProcess();
		}
		return processCompletion;
	}
105245
function start() {
    console.log(
      'Using ts-node version',
      tsNodeVersion + ', typescript version',
      tsVersion
    )
    var cmd = nodeArgs.concat(wrapper, script, scriptArgs)
    var childHookPath = compiler.getChildHookPath()
    cmd = ['-r', childHookPath].concat(cmd)
    log.debug('Starting child process %s', cmd.join(' '))
    child = fork(cmd[0], cmd.slice(1), {
      cwd: process.cwd(),
      env: process.env
    })
    starting = false
    var compileReqWatcher = filewatcher({ forcePolling: opts.poll })
    var currentCompilePath
    fs.writeFileSync(compiler.getCompileReqFilePath(), '')
    compileReqWatcher.add(compiler.getCompileReqFilePath())
    compileReqWatcher.on('change', function(file) {
      fs.readFile(file, 'utf-8', function(err, data) {
        if (err) {
          log.error('Error reading compile request file', err)
          return
        }
        var split = data.split('\n')
        var compile = split[0]
        var compiledPath = split[1]
        if (currentCompilePath == compiledPath) return
        currentCompilePath = compiledPath
        // console.log('compileReqWatcher file change', compile);
        if (compiledPath) {
          compiler.compile({
            compile: compile,
            compiledPath: compiledPath
          })
        }
      })
    })
    child.on('message', function(message) {
      if (!message.compiledPath || currentCompilePath === message.compiledPath)
        return
      currentCompilePath = message.compiledPath
      compiler.compile(message)
    })

    child.on('exit', function(code) {
      log.debug('Child exited with code %s', code)
      if (!child) return
      if (!child.respawn) process.exit(code)
      child = undefined
    })

    if (cfg.respawn) {
      child.respawn = true
    }

    if (compiler.tsConfigPath) {
      watcher.add(compiler.tsConfigPath)
    }

    // Listen for `required` messages and watch the required file.
    ipc.on(child, 'required', function(m) {
      var isIgnored =
        cfg.ignore.some(isPrefixOf(m.required)) ||
        cfg.ignore.some(isRegExpMatch(m.required))

      if (!isIgnored && (cfg.deps === -1 || getLevel(m.required) <= cfg.deps)) {
        watcher.add(m.required)
      }
    })

    // Upon errors, display a notification and tell the child to exit.
    ipc.on(child, 'error', function(m) {
      notify(m.error, m.message, 'error')
      stop(m.willTerminate)
    })
    compiler.writeReadyFile()
  }
200003
def exec_command(
        client, container, command, interactive=True, stdout=None, stderr=None, stdin=None):
    
    exec_id = exec_create(client, container, command, interactive=interactive)

    operation = ExecOperation(client, exec_id,
                              interactive=interactive, stdout=stdout, stderr=stderr, stdin=stdin)
    PseudoTerminal(client, operation).start()
477731
def current_task(self, args):
        
        ctask = self.nice_name if self.nice_name is not None else self.name
        if args is not None:
            if args.update:
                ctask = ctask.replace('%pre', 'Updating')
            else:
                ctask = ctask.replace('%pre', 'Loading')
        return ctask
1147473
def start(self):
        

        # Spawn the listening thread
        self.listen_thread = eventlet.spawn_n(self.listen)

        # Now do the initial load
        self.reload()
368859
def pty_wrapper_main():
    
    # make sure we can import _pty even if pyqode is not installed (this is the case in HackEdit where pyqode has
    # been vendored).
    sys.path.insert(0, os.path.dirname(__file__))
    import _pty

    # fixme: find a way to use a pty and keep stdout and stderr as separate channels
    _pty.spawn(sys.argv[1:])