Returns a line of code with the proper amount of indentationMode.

@param string $line        The line of code.
@param int    $indentLevel The indentation level.

@return string The indented line of code.
338933
private function addIndentation(string $line, int $indentLevel): string
  {
    return ($line==='') ? '' : str_repeat(' ', $this->indentation * $indentLevel).$line;
  }
293069
def format(self, indent_level, indent_size=4):
        

        desc = self.format_name('String')
        return self.wrap_lines(desc, indent_level, indent_size=indent_size)
420882
public static function getLevelCode(
        /*# string */ $level
    )/*# : int */ {
        if (is_string($level) &&
            isset(self::$levels[$level])) {
            return self::$levels[$level];
        }

        throw new Exception\InvalidArgumentException(
            Message::get(
                Message::INVALID_LOG_LEVEL,
                (string) $level
            ),
            Message::INVALID_LOG_LEVEL
        );
    }
1324430
def indent_text(string, indent_level=2):
    """"""
    indented_lines = []

    indent_spaces = ' ' * indent_level

    for line in string.split('\n'):
        indented_lines.append(indent_spaces + line)

    return '\n'.join(indented_lines)
644998
public function getMarkup($indentation = '')
	{
		$line = $this->getOption(self::OPTION_LINE_BREAK);
		$tab = $this->getOption(self::OPTION_INDENTATION);

		$xmlString = '';
		if (empty($this->name)) {
			$last = count($this->children) - 1;
			foreach ($this->children as $i => $child) {
				$xmlString .= $child->getMarkup($indentation);
				if ($i < $last) {
					$xmlString .= $line;
				}
			}
			return $xmlString;
		}

		// no linebreak -> no tabspace
		$indent1 = $indentation;
		if ($line == '') {
			$indent2 = '';
			$indent3 = '';
		}
		else {
			$indent2 = $indentation . $tab;
			$indent3 = $indentation;
		}

		if ($this->isRoot() && !$this->sub) {
			if (static::XML_DECLARATION) {
				$xmlString .= $this->xmlDecl();
			}
			if (count($this->processingInstr) > 0) {
				foreach ($this->processingInstr as $instr) {
					$xmlString .= $instr->getMarkup() . $line;
				}
			}
			if (static::DOCTYPE) {
				$xmlString .= static::DOCTYPE . $line;
			}
		}
		if (count($this->children) > 0) {
			$xmlString .= $indent1 . $this->openingTag() . $line;
			if ($this->cdata) {
				$xmlString .= $indent3 . self::CDATA_START . $line;
			}
			if ($this->content != null) {
				$xmlString .= $indent2 . $this->prepareContent(
						$this->content, $indent2, $line) . $line;
			}
			foreach ($this->children as $child) {
				if (is_string($child)) {
					$xmlString .= $indent2 . $this->prepareContent(
							$child, $indent2, $line) . $line;
				}
				else {
					$xmlString .= $child->getMarkup($indent2) . $line;
				}
			}
			if ($this->cdata) {
				$xmlString .= $indent3 . self::CDATA_STOP . $line;
			}
			$xmlString .= $indent3 . $this->closingTag();
		}
		else {
			$xmlString .= $indent1 . $this->element($indent1, $line, $this->cdata);
		}
		return $xmlString;
	}
1070632
private function renderUses(int $indentLevel = 0): string
    {
        $lines = [];
        foreach ($this->getUses() as $class => $alias) {
            $line = "use {$class}";

            if (!empty($alias)) {
                $line .= " as {$alias};";
            } else {
                $line .= ";";
            }

            $lines[] = $this->addIndent($line, $indentLevel);
        }

        return join("\n", $lines);
    }
402830
public function render(TableStructure $table, int $indent = 12): string
    {
        return str_repeat(' ', $indent) . "'{$this->name}' => " . $this->renderDefinition($table) . ',';
    }
575302
def Indentation( logical_line,
                 previous_logical,
                 indent_level,
                 previous_indent_level ):
  """"""
  comment = '' if logical_line else ' (comment)'
  if indent_level % 2:
    code = 'YCM111' if logical_line else 'YCM114'
    message = ' indentation is not a multiple of two spaces' + comment
    yield 0, code + message
  if ( previous_logical.endswith( ':' ) and
       ( indent_level - previous_indent_level != 2 ) ):
    code = 'YCM112' if logical_line else 'YCM115'
    message = ' expected an indented block of {} spaces{}'.format(
      previous_indent_level + 2, comment )
    yield 0, code + message
422597
protected function getIndentation()
    {
        if ($this->document) {
            if ($this->document->getConfig()->get(FormatterInterface::CFG_USE_TABS)) {
                $indentation = "\t";
            } else {
                $indentation = str_repeat(' ', $this->document->getConfig()->get(FormatterInterface::CFG_INDENTATION));
            }

            return str_repeat($indentation, $this->indentation);
        }
    }
809117
public function toXmlLines($indenter = '  ')
    {
        if ($this->isSkip()) {
            $result = null;
        } else {
            if ($indenter) {
                $prefix = $indenter;
                $prefix2 = $indenter . $indenter;
            } else {
                $prefix = '';
                $prefix2 = '';
            }
            $loc = h((string) $this->getUrl());
            $result = [
                "{$prefix}<url>",
                "{$prefix2}<loc>{$loc}</loc>",
            ];
            $lastModifiedAt = $this->getLastModifiedAt();
            if ($lastModifiedAt !== null) {
                $lastModifiedAt = $lastModifiedAt->format(DateTime::ATOM);
                $result[] = "{$prefix2}<lastmod>{$lastModifiedAt}</lastmod>";
            }
            $changeFrequency = $this->getChangeFrequency();
            if ($changeFrequency !== '') {
                $result[] = "{$prefix2}<changefreq>{$changeFrequency}</changefreq>";
            }
            $priority = $this->getPriority();
            if ($priority !== '') {
                $result[] = "{$prefix2}<priority>{$priority}</priority>";
            }
            foreach ($this->getAlternativeLanguages() as $alternativeLanguage) {
                $result = array_merge($result, $alternativeLanguage->toXmlLines($indenter));
            }
            $result[] = "{$prefix}</url>";
        }

        return $result;
    }
166144
public function indent($level = null)
    {
        $level = $level ?: $this->getLevel();
        array_push($this->indentStack, $level);

        return $level;
    }
721350
def indent(self, code, level=1):
    ''''''
    lines = code.split('\n')
    lines = tuple(self.indent_space*level + line for line in lines)
    return '\n'.join(lines)
905226
public function setIndent($indent)
    {
        if (!$this->isNumber($indent)) {
            throw new ConfigException(ConfigException::MSG_INVALID_ARG, [
                                                                          '$indent',
                                                                          'integer'
                                                                      ]
            );
        }
        $this->indent = $indent;

        return $this;
    }
1057688
def indented(text, level, indent=2):
    """"""
    return "\n".join("%s%s" % (level * indent * " ", s) for s in text.splitlines())
1183113
public static function indent($str, $with = '    ')
    {
        $newline = (substr($str, -1, 1) == "\n") ? "\n" : '';
        return $with . join("\n" . $with, self::lines($str)) . $newline;
    }
685533
protected function renderBody(int $indentLevel): string
    {
        $result = '';
        if (!empty($this->traits)) {
            $result .= $this->renderTraits($indentLevel + 1) . "\n\n";
        }

        if (!$this->constants->isEmpty()) {
            $result .= $this->constants->render($indentLevel + 1) . "\n\n";
        }

        if (!$this->properties->isEmpty()) {
            $result .= $this->properties->render($indentLevel + 1) . "\n\n";
        }

        if (!$this->methods->isEmpty()) {
            $result .= $this->methods->render($indentLevel + 1) . "\n\n";
        }

        return $result;
    }
1223146
function indent(level) {
    var val = options.indent
    _indent = ''

    if (_lastch === null)
      _lastch = _to                 // as-is, this is the first file
    else if (_lastch !== _to) {
      _lastch = _to
      // istanbul ignore else
      if (output)
        output.emit('data', _to)    // force eol after insert file
    }

    if (level > 0 && val && !/^0+\D?/.test(val)) {
      // format is 2, 2t, 2s, etc. default is spaces
      var match = /^(\d+)\s*(t?)/.exec(val),
          count = level * (match[1] | 0)
      _indent = Array(count + 1).join(match[2] ? '\t' : ' ')
    }
  }