TODO(dpb): Account for indentation level.
353066
private static SuggestedFix.Builder addPrivateConstructor(ClassTree classTree) {
    SuggestedFix.Builder fix = SuggestedFix.builder();
    String indent = "  ";
    for (Tree member : classTree.getMembers()) {
      if (member.getKind().equals(METHOD) && !isGeneratedConstructor((MethodTree) member)) {
        fix.prefixWith(
            member,
            indent + "private " + classTree.getSimpleName() + "() {} // no instances\n" + indent);
        break;
      }
      if (!member.getKind().equals(METHOD)) {
        indent = "";
      }
    }
    return fix;
  }
803020
function () {
            var indentStr = '';
            for (var i = 0; i < indentLevel; i++) {
                indentStr += INDENT;
            }
            return {
                type: 'WhiteSpace',
                value: indentStr
            };
        }
1056724
def check_indent(self, definition, docstring):
        
        if docstring:
            indent = self._get_docstring_indent(definition, docstring)
            lines = docstring.split('\n')
            if len(lines) > 1:
                lines = lines[1:]  # First line does not need indent.
                indents = [leading_space(l) for l in lines if not is_blank(l)]
                if set(' \t') == set(''.join(indents) + indent):
                    yield violations.D206()
                if (len(indents) > 1 and min(indents[:-1]) > indent or
                        indents[-1] > indent):
                    yield violations.D208()
                if min(indents) < indent:
                    yield violations.D207()
168999
function() {
			if ( !this._.inPre && this._.indentation )
				this._.output.push( this._.indentation );
			this._.indent = 0;
		}
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)
196404
def dumpindented(self, pn, indent=0):
        
        page = self.readpage(pn)
        print("  " * indent, page)
        if page.isindex():
            print("  " * indent, end="")
            self.dumpindented(page.preceeding, indent + 1)
            for p in range(len(page.index)):
                print("  " * indent, end="")
                self.dumpindented(page.getpage(p), indent + 1)
1053551
def _get_docstring_indent(definition, docstring):
        """"""
        before_docstring, _, _ = definition.source.partition(docstring)
        _, _, indent = before_docstring.rpartition('\n')
        return indent
307965
def _get_indent(marker, s, tab_width=8):
    """"""
    # Figure out how much the marker is indented.
    INDENT_CHARS = tuple(' \t')
    start = s.index(marker)
    i = start
    while i > 0:
        if s[i - 1] not in INDENT_CHARS:
            break
        i -= 1
    indent = s[i:start]
    indent_width = 0
    for ch in indent:
        if ch == ' ':
            indent_width += 1
        elif ch == '\t':
            indent_width += tab_width - (indent_width % tab_width)
    return indent, indent_width
599311
List<Token> analyzeIndentations(List<Token> tokens, Object lf) {
    if (tokens.isEmpty()) {
      return tokens;
    }
    int size = tokens.size();
    List<Token> result = Lists.arrayList(size + size / 16);
    Stack<Integer> indentations = new Stack<Integer>();
    boolean freshLine = true;
    int lfIndex = 0;
    for (Token token : tokens) {
      if (freshLine) {
        int indentation = token.index() - lfIndex;
        if (Objects.equals(token.value(), lf)) {
          // if first token on a line is lf, indentation is ignored.
          indentation = 0;
        }
        newLine(token, indentations, indentation, result);
      }
      if (Objects.equals(token.value(), lf)) {
        freshLine = true;
        lfIndex = token.index() + token.length();
      }
      else {
        freshLine = false;
        result.add(token);
      }
    }
    Token lastToken = tokens.get(tokens.size() - 1);
    int endIndex = lastToken.index() + lastToken.length();
    Token outdentToken = pseudoToken(endIndex, outdent);
    for (int i = 0; i < indentations.size() - 1; i++) {
      // add outdent for every remaining indentation except the first one
      result.add(outdentToken);
    }
    return result;
  }
985142
function getIndentLevel(node, profile) {
	// Increase indent level IF NOT:
	// * parent is text-only node
	// * there’s a parent node with a name that is explicitly set to decrease level
	const skip = profile.get('formatSkip') || [];
	let level = node.parent.isTextOnly ? -2 : -1;
	let ctx = node;
	while (ctx = ctx.parent) {
		if (skip.indexOf( (ctx.name || '').toLowerCase() ) === -1) {
			level++;
		}
	}

	return level < 0 ? 0 : level;
}
445470
def _attrprint(d, delimiter=', '):
    """"""
    return delimiter.join(('"%s"="%s"' % item) for item in sorted(d.items()))
756626
String indent(String s, int level) {
        return Stream.of(s.split("\n"))
                .map(sub -> INDENT_STRING.substring(0, level * INDENT_WIDTH) + sub)
                .collect(Collectors.joining("\n"));
    }
1344715
def indent(self):
        
        blk = IndentBlock(self, self._indent)
        self._indent += 1
        return blk
115675
def _makeIndentFromWidth(self, width):
        
        if self._indenter.useTabs:
            tabCount, spaceCount = divmod(width, self._indenter.width)
            return ('\t' * tabCount) + (' ' * spaceCount)
        else:
            return ' ' * width
151375
def assign_indent_numbers(lst, inum, dic=collections.defaultdict(int)):
    
    for i in lst:
        dic[i] = inum
    return dic
245800
function indent(str/*: string*/, level/*: number*/ = 1) /*: string*/ {
    if (typeof str === 'number') [ level, str ] = [ str, level ];
    if (typeof level !== 'number') level = 1;
    return (str || '').replace(/^/gm, '  '.repeat(level));
}
235063
def indent(text, num=4):
    """"""
    str_indent = ' ' * num
    return str_indent + ('\n' + str_indent).join(text.splitlines())