Stop block with save or echo.
505607
public function stopBlock($name = null)
    {
        if (empty($this->currentBlockName)) {
            throw new InvalidParamException(
                "Unexpected stopBlock in '{$this->processingViewFile}'"
            );
        }
        if (!empty($name) && $this->currentBlockName != $name) {
            throw new InvalidParamException(
                "Expected current closed block name '{$this->currentBlockName}' instead of '{$name}'"
              . " in '{$this->processingViewFile}'"
            );
        }
        $name = $this->currentBlockName;

        $fullBlockName = $this->getCurrentBlockFullName();

        array_pop(static::$_blocksStack);

        $content = ob_get_clean();

        // save every block of every view-file in inherit chain (not only for last) - it will need for render parentBlock
        if (!$this->viewBlocks($this->processingViewFile)->exists($fullBlockName)) {
            $this->viewBlocks($this->processingViewFile)->add($fullBlockName, $content);
        }

        $savedContent = $this->findProperBlock($fullBlockName, $this->processingViewFile);
        if ($savedContent !== false) {
            $content = $savedContent; // rewrite
        }
        if ($savedContent !== false && empty($this->_extendingParent[$this->processingViewFile])) {
            // such block already saved - replace block in parent view-template by saved content
            $n = $this->hasParentBlock($savedContent);
            while ($n--) {
                $savedContent = $this->replaceParentBlock($savedContent);
            }
            echo $savedContent;
        } else {
            echo $content; // always echo - to catch by outer block
        }
    }
27423
def stop(self):
        
        action = {'action': 'stop'}
        j, r = self.datacenter.request('POST', self.path, params=action)
        r.raise_for_status()
34270
public function cancel()
    {
        if (!empty($this->stack)) {
            array_pop($this->stack);
            if ($this->capturing > 0) {
                $this->capturing--;
                ob_end_flush();
            }
        }
    }
1345008
def stop(self, **kwargs):
        
        path = '%s/%s/stop' % (self.manager.path, self.get_id())
        self.manager.gitlab.http_post(path, **kwargs)
31179
def block(self, warn_only=False):
        """"""
        self._state = "not finished"
        if self._return_code is None:
            proc = subprocess.Popen(
                self.cmd, cwd=self.cwd, env=self.env,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE
            )
            self._stdout, self._stderr = proc.communicate(timeout=self.timeout)
            self._return_code = proc.returncode

        self._state = FINISHED
        if not warn_only:
            self.raise_for_error()
531001
def stop_capture(self):
        """"""
        super(Treal, self).stop_capture()
        if self._machine:
            self._machine.close()
        self._stopped()
1232263
def stop(self):
        """"""
        if not self._dead:
            self._killed = True
            self._cancelled.set()
            self._busy_sem.release()
            self.join()
            if not self._ready_sem.acquire(False):
                warning("ISOTP Timer thread may not have stopped "
                        "correctly")
983982
def stop(self):
        """"""
        if self.thread:
            self.running = False
            if isinstance(self.stream, ReadWriteStream):
                self.stream.write(b'\0' * self.chunk_size)
            self.thread.join()
            self.thread = None

        self.engine.stop()

        if self.pa:
            self.pa.terminate()
            self.stream.stop_stream()
            self.stream = self.pa = None
449540
def stop(ctx, rm=False):
    ''''''
    with ctx.cd(ROOT):
        compose(ctx, 'stop')
        if rm:
            compose(ctx, 'rm --force')
363611
public function stop()
    {
        if ($this->isBusy()) {
            posix_kill($this->workPid, \SIGKILL);
            $this->getWorkState(true);
        }
    }
813393
def stop(logfile, time_format):
  ""

  def save_and_output(records):
    records = server.stop(records)
    write(records, logfile, time_format)

    def output(r):
      print "worked on %s" % colored(r[0], attrs=['bold'])
      print "  from    %s" % colored(
        server.date_to_txt(r[1][0], time_format), 'green')
      print "  to now, %s" % colored(
        server.date_to_txt(r[1][1], time_format), 'green')
      print "       => %s elapsed" % colored(
        time_elapsed(r[1][0], r[1][1]), 'red')

    output(records[-1])

  save_and_output(read(logfile, time_format))
1316202
public function stopAndSave()
    {
        $this->codeCoverage->stop();

        Storage::storeCodeCoverage(
            $this->codeCoverage,
            $this->storageDirectory,
            uniqid(date('YmdHis'), true)
        );
    }
866906
def stop(self):
        """"""
        if self._timer:
            self._timer.stop()
            self._timer.deleteLater()
1202227
public function stop()
    {
        go(function(){
            $fileName = Imi::getRuntimePath(str_replace('\\', '-', App::getNamespace()) . '.pid');
            if(!is_file($fileName))
            {
                exit(sprintf('Pid file %s is not exists', $fileName));
            }
            $pid = json_decode(File::readFile($fileName), true);
            if($pid > 0)
            {
                $cmd = 'kill ' . $pid['masterPID'];
                echo $cmd, PHP_EOL;
                $result = Coroutine::exec($cmd);
                echo 'code:', $result['code'], ', signal:', $result['signal'], ', output:', $result['output'], PHP_EOL;
            }
            else
            {
                echo 'Pid does not exists!', PHP_EOL;
            }
        });
    }
580967
def do_quit(self, arg):
        """"""
        if self.saved:
            self.save()
        else:
            self.parser.clean()
        return True
402760
def _stop_thread(self):
        """"""
        self._stopping_event.set()
        queue_content = []
        try:  # give the enqueueing thread chance to put a batch to the queue and check the stopping event
            while True:
                queue_content.append(self._queue.get_nowait())
        except Empty:
            pass
        self._enqueueing_thread.join()
        try:
            queue_content.append(self._queue.get_nowait())  # collect the very last item
        except Empty:
            pass
        self._queue = Queue(max(len(queue_content), self._buffer_size))  # queue content may be bigger than queue size
        for batch in queue_content:
            self._queue.put(batch)
541033
def Stop(self):
    """"""
    self._Close()

    if self._rpc_thread.isAlive():
      self._rpc_thread.join()
    self._rpc_thread = None