indento
Indents the input string.

@name indento
@function
@param {String} input The input string.
@param {Number} width The indent width.
@param {String} char The character to use for indentation (default: `" "`).
@return {String} The indented string.
515683
function indento(input, width, char) {
    char = typeof char !== "string" ? " " : char;
    return String(input).replace(/^/gm, char.repeat(width));
}
801568
function indent(str, indent) {
            if (typeof indent === 'number') {
                var indent_str = '';
                while (indent_str.length < indent) indent_str += ' ';
                indent = indent_str;
            }
            var lines = str.split(/\n/);
            for (var i=0; i<lines.length; i++) {
                if (lines[i].trim() !== '')
                    lines[i] = indent + lines[i];
            }
            return lines.join("\n");            
        }
114171
def indentsize(line):
    """"""
    expline = string.expandtabs(line)
    return len(expline) - len(string.lstrip(expline))
1266393
function _inputChar(char) {
    if(_charIsPrintable(char.charCodeAt(0))
      &&utils.isSelectable(document.activeElement)) {
      // add the char
      // FIXME: put at caretPosition/replace selected content
      document.activeElement.value += char;
      // fire an input event
      utils.dispatch(document.activeElement, {type: 'input'});
    }
  }
29287
function() {
    var i = 2
      , type;
    switch (this.lookahead(i).type) {
      case '{':
      case 'indent':
      case ',':
        return true;
      case 'newline':
        while ('unit' == this.lookahead(++i).type
            || 'newline' == this.lookahead(i).type) ;
        type = this.lookahead(i).type;
        return 'indent' == type || '{' == type;
    }
  }
1208001
def indent_width(self, value):
        

        if value is not None:
            assert type(value) is int, "'{0}' attribute: '{1}' type is not 'int'!".format("indent_width", value)
        self.__indent_width = value
936015
def indent(self, value):
        """"""
        # Explicit indent setting
        if isinstance(value, str):
            if value.isspace() or len(value) == 0:
                self._indent = value
            else:
                raise ValueError('String indentation can only contain '
                                 'whitespace.')

        # Set indent width
        elif isinstance(value, int):
            if value >= 0:
                self._indent = value * ' '
            else:
                raise ValueError('Indentation spacing must be nonnegative.')

        else:
            raise TypeError('Indentation must be specified by string or space '
                            'width.')
1323636
public static function varToString($input, $indent = '')
	{
		switch (gettype($input))
		{
			case 'string':
				return "'" . str_replace(array("\\", "'"), array("\\\\", "\\'"), $input) . "'";
			case 'array':
				$output = "array(\r\n";
				foreach ($input as $key => $value)
				{
					$output .= $indent . "\t" . self::varToString($key, $indent . "\t") . ' => ' . self::varToString(
						$value, $indent . "\t");
					$output .= ",\r\n";
				}
				$output .= $indent . ')';
				return $output;
			case 'boolean':
				return $input ? 'true' : 'false';
			case 'NULL':
				return 'NULL';
			case 'integer':
			case 'double':
			case 'float':
				return "'" . (string) $input . "'";
		}
		return 'NULL';
	}
1349494
protected function indentPrettyPrintedJson($jsonString, $indentStyle, $defaultIndentSize = 2)
    {
        $indentChar = $this->getIndentCharForIndentStyle($indentStyle);
        $indentSize = $this->getPrettyPrintIndentSize() ?: $defaultIndentSize;

        // If the given indentation style is allowed to have various indent size
        // (number of chars, that are used to indent one level in each line),
        // indent the JSON string with given (or default) indent size.
        if ($this->hasVariousIndentSize($indentStyle)) {
            return $this->peformIndentation($jsonString, $indentChar, $indentSize);
        }

        // Otherwise following the convention, that indent styles, that does not
        // allowed to have various indent size (e.g. tab) are indented using
        // one tabulation character per one indent level in each line.
        return $this->peformIndentation($jsonString, $indentChar);
    }
1273983
def _add_indent(string, indent):
    
    lines = string.split("\n")
    first, lines = lines[0], lines[1:]
    lines = ["{indent}{s}".format(indent=" " * indent, s=s)
             for s in lines]
    lines = [first] + lines
    return "\n".join(lines)
954233
private static String wrapWith(char wrapper, String... input) {
        StringBuilder escaped = new StringBuilder();
        for (String i : input) {
            escaped.append(", ");
            escaped.append(wrapper).append(i).append(wrapper);
        }
        if (escaped.length() > 2) {
            escaped.delete(0, 2);
        }
        return escaped.toString();
    }
520612
def putch(self, char):
        
        if char == '\r':
            self.carriage_return()

        elif char == '\n':
            self.newline()

        elif char == '\b':
            self.backspace()

        elif char == '\t':
            self.tab()

        else:
            w = self.font.getsize(char)[0]
            if self._cx + w >= self._device.width:
                self.newline()

            self.erase()
            self._canvas.text((self._cx, self._cy),
                              text=char,
                              font=self.font,
                              fill=self._fgcolor)

            self._cx += w
            if self.animate:
                self.flush()
681392
def _indent(string, count):
    ''''''
    indent = _INDENT * count
    ret = indent + string.replace('\n', '\n' + indent)
    return ret.rstrip()
732546
function getExpectedIndent(line) {
            const offset = offsets.get(line)
            if (!offset) {
                return 0
            }
            if (offset.expectedIndent !== undefined) {
                return offset.expectedIndent
            }
            const baseIndent = getExpectedIndent(offset.baseline)

            const expectedIndent =
                baseIndent + offset.offset * options.indentSize

            offset.expectedIndent = expectedIndent
            return expectedIndent
        }
1252904
function(input) {
		var result = {};
		if ('selectionStart' in input) {
			result.start = input.selectionStart;
			result.length = input.selectionEnd - result.start;
		} else if (document.selection) {
			input.focus();
			var sel = document.selection.createRange();
			var selLen = document.selection.createRange().text.length;
			sel.moveStart('character', -input.value.length);
			result.start = sel.text.length - selLen;
			result.length = selLen;
		}
		return result;
	}
418952
def indent(text, indent=2, width=128):
    
    return "\n".join(
        textwrap.wrap(text,
                      width=width,
                      initial_indent=" " * indent,
                      subsequent_indent=" " * indent))
192799
def indent_func(input_):
    
    if isinstance(input_, six.string_types):
        # A label was specified
        lbl = input_
        return _indent_decor(lbl)
    elif isinstance(input_, (bool, tuple)):
        # Allow individually turning of of this decorator
        func = input_
        return func
    else:
        # Use the function name as the label
        func = input_
        lbl = '[' + meta_util_six.get_funcname(func) + ']'
        return _indent_decor(lbl)(func)