Draw the progress bar, if necessary

@param string $current
@param string $label
962843
protected function drawProgressBar($current, $label)
    {
        $percentage = $this->percentageFormatted($current / $this->total);

        if ($this->shouldRedraw($percentage, $label)) {
            $progress_bar = $this->getProgressBar($current, $label);
            $this->output->write($this->parser->apply($progress_bar));
        }

        $this->current_percentage = $percentage;
    }
188811
protected function progress( $marker ) {
		$this->output->write( $marker );
		$this->progressCount++;
		if ( $this->progressCount > 60 ) {
			$this->progressCount = 0;
			$this->output->write( "\n" );
		}
	}
567515
def progress(self, *msg):
        
        label = colors.purple("Progress")
        self._msg(label, *msg)
1189911
public void mark(Label label) {
        adopt(label);
        if (label.marked) {
            throw new IllegalStateException("already marked");
        }
        label.marked = true;
        if (currentLabel != null) {
            jump(label); // blocks must end with a branch, return or throw
        }
        currentLabel = label;
    }
149666
static function writeDebug( $conditionName, $string, $label = "" )
    {
        if ( !eZDebugSetting::isConditionTrue( $conditionName, eZDebug::LEVEL_DEBUG ) )
            return false;
        eZDebug::writeDebug( $string, eZDebugSetting::changeLabel( $conditionName, $label ) );
    }
109555
private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string
    {
        if ('' === $text) {
            return '';
        }

        if (!$width) {
            return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text;
        }

        if (!$currentLineLength && '' !== $current) {
            $text = ltrim($text);
        }

        if ($currentLineLength) {
            $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n";
            $text = substr($text, $i);
        } else {
            $prefix = '';
        }

        preg_match('~(\\n)$~', $text, $matches);
        $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text);
        $text = rtrim($text, "\n").($matches[1] ?? '');

        if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) {
            $text = "\n".$text;
        }

        $lines = explode("\n", $text);

        foreach ($lines as $line) {
            $currentLineLength += \strlen($line);
            if ($width <= $currentLineLength) {
                $currentLineLength = 0;
            }
        }

        if ($this->isDecorated()) {
            foreach ($lines as $i => $line) {
                $lines[$i] = $this->styleStack->getCurrent()->apply($line);
            }
        }

        return implode("\n", $lines);
    }
924270
public static function point($label = null, $isMultiplePoint = false)
    {
        if( ! static::enableTool() )
            return;

        // Run
        static::$performance->point($label, $isMultiplePoint);
    }
1197668
public function useCurrent($current=null)
    {
        if (isset($current)) {
            $this->current = (bool) $current;
            return $this;
        }
        else {
            return $this->current;
        }
    }
307753
def markCurrentChanged(self):
        
        view = self.currentView()
        if view:
            view.setCurrent()
            self.setFocus()
            view.setFocus()
            self._hintLabel.hide()
        else:
            self._hintLabel.show()
            self._hintLabel.setText(self.hint())

        if not self.count():
            self.tabBar().clear()

        self.adjustSizeConstraint()
3472
private function scalar($scalar, string $label = ''): void
    {
        if (is_bool($scalar)) {
            $scalar = $scalar ? 'true' : 'false';
        } elseif (is_string($scalar)) {
            $scalar = "'{$this->escape($scalar)}'";
        }

        if ($label !== '') {
            $label = $this->escape($label);

            echo "console.log('%c{$label}','font-weight:bold',{$scalar});";
        } else {
            echo "console.log({$scalar});";
        }
    }
54654
public function progressBar($total = null, $done = null, $width = null) {
        if (empty($total) || ($total <= 0)) {
            return false;
        }

        //calculate width
        $columns = $this->getScreen('columns');
        if ($columns < 50)
            return false;
        if (null === $width) {
            $width = 200;
        }
        $extraWidth = strlen((string)$total) * 2 + 1;
        if ($width + 35 + $extraWidth > $columns) {
            $width = $columns - 35 - $extraWidth;
        }

        $this->activeProgressBar = array(
            'width' => $width,
            'done' => $done,
            'total' => $total,
            'startTime' => microtime(true),
            'startProgress' => $done,
        );
        $this->progress(null, null, null, 0);
    }
611650
public function setLabel($label)
        {
            if (null !== $label && !is_string($label)) {
                throw new Exception(
                        'Invalid argument: $label must be a string or null');
            }

            $this->_label = $label;
            return $this;
        }
286204
public function draw(): void
	{
		// Don't draw progess bar if there are 0 items

		if($this->items === 0)
		{
			return;
		}

		// Calculate percent

		$percent = (float) min(($this->progress / $this->items), 1);

		// Build progress bar

		$progressBar = $this->buildProgressBar($percent);

		// Draw progressbar

		$this->output->write("\r" . $this->prefix . $progressBar);

		// If we're done then we'll add a newline to the output

		if($this->progress === $this->items)
		{
			$this->output->write(PHP_EOL);
		}
	}
660293
@Override
    public void visitLabel(Label label) {
        super.visitLabel(label);

        if (waitingForSuper) {
            // Get what should be the shape of the stack in the handler.
            // Not all labels are branch targets so only deal with targets
            if (branchTargets.containsKey(label)) {
                currentStack = branchTargets.get(label);
            }
        } else {
            pendingExceptionHandlerTypeName = handlers.get(label);
        }
    }
1268962
public function addCurrentGrandParent($label = null)
    {
        $parent = $this->menu->getCurrentParent();

        if ($parent && (! $parent->isTopLevel())) {
            $grandPa = $parent->getParent();
            if ($grandPa && (! $grandPa->isTopLevel())) {
                $this->addMenuItem($grandPa, $label);
            }
        }
        return $this;
    }
593318
public function addExcerpt($current)
    {
        list($excerpt, $hasMore) = $this->getUntilMore($current->text);
        $current->excerpt = $excerpt;
        $current->hasMore = $hasMore;
    }
676500
private function startProgressBars(BufferedOutputInterface $output)
    {
        // Start and display the progress bars.
        foreach ($this->processes as $processInfo) {
            $processInfo['progressBar']->start();
            $output->write("\n");

            // Set the current index. For simplicity we overwrite the value each time.
            $this->currentIndex = $processInfo['index'];
        }
    }