Returns the indentation for this node
    Iff a node is in a suite, then it has indentation.
11770
def indentation(node):
    
    while node.parent is not None and node.parent.type != syms.suite:
        node = node.parent
    if node.parent is None:
        return u""
    # The first three children of a suite are NEWLINE, INDENT, (some other node)
    # INDENT.value contains the indentation for this suite
    # anything after (some other node) has the indentation as its prefix.
    if node.type == token.INDENT:
        return node.value
    elif node.prev_sibling is not None and node.prev_sibling.type == token.INDENT:
        return node.prev_sibling.value
    elif node.prev_sibling is None:
        return u""
    else:
        return node.prefix
189050
def fix_indentation(code, new_indents):
    """"""
    min_indents = find_minimum_indents(code)
    return indent_lines(code, new_indents - min_indents)
1140160
function hasOctalEscapeSequence(node) {
    if (isConcatenation(node)) {
        return hasOctalEscapeSequence(node.left) || hasOctalEscapeSequence(node.right);
    }

    return isOctalEscapeSequence(node);
}
1030459
def unless_node(node, indent)
      # Check if we have any condition met, or an else branch
      node[@value].each_with_index do |value, index|
        # If we have a branch that meets the condition, generate code for the
        # children related to that specific branch
        case value
        when node[@value].first then buffer_eval "unless #{value}"
        else buffer_eval "else"
        end

        # Evaluate child nodes
        node[@children][index].each do |child|
          root child, indent
        end
      end

      # End
      buffer_eval "end"
    end
1053551
def _get_docstring_indent(definition, docstring):
        """"""
        before_docstring, _, _ = definition.source.partition(docstring)
        _, _, indent = before_docstring.rpartition('\n')
        return indent
1364085
float indentLeft() {
        if (isRTL) {
            switch (alignment) {
                case Element.ALIGN_LEFT:
                    return left + width;
                case Element.ALIGN_CENTER:
                    return left + (width / 2f);
                default:
                    return left;
            }
        }
        else if (this.getSeparatorCount() == 0) {
            switch (alignment) {
                case Element.ALIGN_RIGHT:
                    return left + width;
                case Element.ALIGN_CENTER:
                    return left + (width / 2f);
            }
        }
        return left;
    }
406495
def if_node(node, indent)
      # Check if we have any condition met, or an else branch
      node[@value].each_with_index do |value, index|
        # If we have a branch that meets the condition, generate code for the
        # children related to that specific branch
        case value
        when node[@value].first then buffer_eval "if #{value}"
        when node[@value].last then buffer_eval "else"
        else buffer_eval "elsif #{value}"
        end

        # Evaluate child nodes
        node[@children][index].each do |child|
          root child, indent
        end
      end

      # End
      buffer_eval "end"
    end
1042820
def indent(indent_str=None):
    

    def indentation_rule():
        inst = Indentator(indent_str)
        return {'layout_handlers': {
            OpenBlock: layout_handler_openbrace,
            CloseBlock: layout_handler_closebrace,
            EndStatement: layout_handler_semicolon,
            Space: layout_handler_space_imply,
            OptionalSpace: layout_handler_space_optional_pretty,
            RequiredSpace: layout_handler_space_imply,
            Indent: inst.layout_handler_indent,
            Dedent: inst.layout_handler_dedent,
            Newline: inst.layout_handler_newline,
            OptionalNewline: inst.layout_handler_newline_optional,
            (Space, OpenBlock): NotImplemented,
            (Space, EndStatement): layout_handler_semicolon,
            (OptionalSpace, EndStatement): layout_handler_semicolon,
            (Indent, Newline, Dedent): rule_handler_noop,
        }}
    return indentation_rule
176640
function indent(node) {
  var next = node;
  var i = 0;
  while (next) {
    ++i;
    next = next.suite || next.parent;
  }
  return Array(i).join('  ');
}
81696
def printChildElements( element, indent = 0 )

      indentation = ""
      indent.times{ indentation << " " } if indent > 0

      if element and element.is_a?( REXML::Element ) and element.has_elements?

         attributes = getAttributeString( element )
         name = lookupFieldName( element )
         puts "#{indentation}#{name} #{attributes}:"

         element.each { |element|
            if element.is_a?( REXML::Element ) and element.has_elements?
               printChildElements( element, (indent+1) )
            elsif element.is_a?( REXML::Element ) and element.has_text?
               attributes = getAttributeString( element )
               name = lookupFieldName( element )
               text = formatFieldValue( element.text, lookupFieldType( element ) )
               puts " #{indentation}#{name} #{attributes} = #{text}"
            end
         }
      elsif element and element.is_a?( Array )
         element.each{ |e| printChildElements( e ) }
      end
      self
   end
68441
def indent(self):
        

        cursor = self.textCursor()
        if not cursor.hasSelection():
            cursor.insertText(self.__indent_marker)
        else:
            block = self.document().findBlock(cursor.selectionStart())
            while True:
                block_cursor = self.textCursor()
                block_cursor.setPosition(block.position())
                block_cursor.insertText(self.__indent_marker)
                if block.contains(cursor.selectionEnd()):
                    break
                block = block.next()
        return True
558602
String getIndentation()
	{
		StringBuilder sb = new StringBuilder();

		for (int i = 0; i < count; i++)
		{
			sb.append(indent);
		}

		return sb.toString();
	}
557093
def visit_tag(current_node)
      attributes = formatted_attributes(current_node)
      children_wo_attributes = (current_node.children - current_node.attributes)

      text = "<#{current_node.name}"

      text += attributes.to_s unless attributes.empty?

      other_than_new_lines = children_wo_attributes.any? { |n| n.type != :newline }

      text += if other_than_new_lines
                '>'
              else
                '/>'
              end

      conditional_nodes = current_node.children.select { |n| n.type == :output && n.conditional }

      unless conditional_nodes.empty?
        buff_code "if (#{conditional_nodes.map(&:value).join(') && (')})"

        @code_indent += 1
      end

      buff_print_text(text, new_line: true, indent: true)

      if other_than_new_lines
        last_node = children_wo_attributes.last
        is_last_newline = !last_node.nil? && last_node.type == :newline
        nodes = if is_last_newline
                  children_wo_attributes[0...-1]
                else
                  children_wo_attributes
                end

        code_indent do
          visit_nodes(nodes)
        end

        buff_print_text("</#{current_node.name}>", new_line: true, indent: true)

        # print new line after the tag
        visit_node(last_node) if is_last_newline
      end

      unless conditional_nodes.empty? # rubocop:disable Style/GuardClause
        @code_indent -= 1

        buff_code 'end'
      end
    end
1060452
function (nodes, indent, excludeCommas) {
    nodes.forEach(function (node) {
      var nodeIndent = getNodeIndent(node, false, excludeCommas);
      if (nodeIndent !== indent) {
        context.report(node, MESSAGE, { gotten: nodeIndent, needed: indent });
      }
    });
  }
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
402319
function indentClassLeft( node, classes ) {
		var indentClass = node.$.className.match( this.classNameRegex ),
			isIndent = this.isIndent;

		// If node has one of the indentClasses:
		//	* If it holds the topmost indentClass, then
		//	  no more classes have left.
		//	* If it holds any other indentClass, it can use the next one
		//	  or the previous one.
		//	* Outdent is always possible. We can remove indentClass.
		if ( indentClass )
			return isIndent ? indentClass[ 1 ] != classes.slice( -1 ) : true;

		// If node has no class which belongs to indentClasses,
		// then it is at 0-level. It can be indented but not outdented.
		else
			return isIndent;
	}
1177227
def root(parent = @root, min_indent = -1)
      while (@line = @code[(@i += 1)])
        # Reset character position cursor
        @j = 0

        # Skip to next iteration if we have a blank line
        next if @line =~ /\A\s*\Z/

        # Reset the line offset
        @offset = 0

        # Parse the current line by trying to match each node type towards it
        # Add current indentation to the indent stack
        indent = accept(:indent).size

        # Stop using the current parent as root if it does not match the
        # minimum indentation includements
        unless min_indent < indent
          @i -= 1
          break
        end

        # If last include path had a greater indentation, pop the last file path
        @file.pop if @file[-1][1] >= indent

        # Try the main Opulent node types and process each one of them using
        # their matching evaluation procedure
        current_node = node(parent, indent) ||
                       text(parent, indent) ||
                       comment(parent, indent) ||
                       define(parent, indent) ||
                       control(parent, indent) ||
                       evaluate(parent, indent) ||
                       filter(parent, indent) ||
                       block_yield(parent, indent) ||
                       include_file(parent, indent) ||
                       html_text(parent, indent) ||
                       doctype(parent, indent)

        # Throw an error if we couldn't find any valid node
        unless current_node
          Logger.error :parse, @code, @i, @j, :unknown_node_type
        end
      end

      parent
    end