returns a html block of line indentation to show that it is underneath its parent
 Params:
 +cont+:: a hash of the record you are checking against
14334
def ancestory_indent(cont)

      html = ''
      cont.ancestor_ids.length

      i = 0
      while i < cont.ancestor_ids.length  do
        html += "<i class=\"fa fa-minus\"></i>"
        i += 1
      end

      html += "&nbsp;" if !html.blank?

      render :inline =>  html.html_safe

    end
215465
function validateIndent() {
            /**
             * Check whether the line start is in template tag.
             * @param {number} line The line.
             * @returns {boolean} `true` if the line start is in template tag.
             */
            function inTemplateTag(line) {
                if (line <= 1) {
                    return false
                }
                const lineStartIndex = sourceCode.getIndexFromLoc({
                    line,
                    column: 0,
                })
                return microTemplateService.inTemplateTag(lineStartIndex - 1)
            }

            /**
             * Define the function which fixes the problem.
             * @param {number} line The number of line.
             * @param {string} actualText The actual indentation text.
             * @param {ExpectedIndent} expectedIndent The expected indentation info.
             * @returns {function} The defined function.
             */
            function defineFix(line, actualText, expectedIndent) {
                return fixer => {
                    const start = sourceCode.getIndexFromLoc({
                        line,
                        column: 0,
                    })
                    const indent = expectedIndent.indentText
                    return fixer.replaceTextRange(
                        [start, start + actualText.length],
                        indent
                    )
                }
            }

            /**
             * Validate base point indentation.
             * @param {number} line The number of line.
             * @param {string} actualText The actual indentation text.
             * @param {ExpectedIndent} expectedIndent The expected indent.
             * @returns {void}
             */
            function validateBaseIndent(line, actualText, expectedIndent) {
                const expectedBaseIndentText = expectedIndent.baseIndentText
                if (
                    expectedBaseIndentText &&
                    (actualText.length < expectedBaseIndentText.length ||
                        !actualText.startsWith(expectedBaseIndentText))
                ) {
                    context.report({
                        loc: {
                            start: { line, column: 0 },
                            end: {
                                line,
                                column: actualText.length,
                            },
                        },
                        messageId: actualText
                            ? "unexpectedBaseIndentation"
                            : "missingBaseIndentation",
                        data: {
                            expected: JSON.stringify(expectedBaseIndentText),
                            actual: actualText
                                ? JSON.stringify(
                                      actualText.slice(
                                          0,
                                          expectedBaseIndentText.length
                                      )
                                  )
                                : "",
                        },
                        fix: defineFix(line, actualText, expectedIndent),
                    })
                    return false
                }
                return true
            }

            offsets.forEach((value, line) => {
                if (!inTemplateTag(line)) {
                    return
                }
                if (!getLineText(line).trim()) {
                    // empty line
                    return
                }
                const actualText = value.actualText
                const expectedIndent = getExpectedIndent(line)
                if (!expectedIndent) {
                    return
                }
                if (!validateBaseIndent(line, actualText, expectedIndent)) {
                    return
                }
                const expectedBaseIndent = expectedIndent.baseIndentText.length

                const actualRelativeText = actualText.slice(expectedBaseIndent)

                for (let i = 0; i < actualRelativeText.length; ++i) {
                    if (actualRelativeText[i] !== options.indentChar) {
                        context.report({
                            loc: {
                                start: { line, column: expectedBaseIndent + i },
                                end: {
                                    line,
                                    column: expectedBaseIndent + i + 1,
                                },
                            },
                            messageId: "unexpectedIndentationCharacter",
                            data: {
                                expected: JSON.stringify(options.indentChar),
                                actual: JSON.stringify(actualRelativeText[i]),
                            },
                            fix: defineFix(line, actualText, expectedIndent),
                        })
                        return
                    }
                }

                const actualRelativeIndent = actualRelativeText.length

                if (actualRelativeIndent !== expectedIndent.indent) {
                    context.report({
                        loc: {
                            start: { line, column: expectedBaseIndent },
                            end: { line, column: actualText.length },
                        },
                        messageId: expectedBaseIndent
                            ? "unexpectedRelativeIndentation"
                            : "unexpectedIndentation",
                        data: {
                            expectedIndent: expectedIndent.indent,
                            actualIndent: actualRelativeIndent,
                            unit,
                            expectedIndentPlural:
                                expectedIndent.indent === 1 ? "" : "s",
                            actualIndentPlural:
                                actualRelativeIndent === 1 ? "" : "s",
                        },
                        fix: defineFix(line, actualText, expectedIndent),
                    })
                }
            })
        }
1165902
def detect_fold_level(self, prev_block, block):
        
        text = block.text()
        prev_lvl = TextBlockHelper().get_fold_lvl(prev_block)
        # round down to previous indentation guide to ensure contiguous block
        # fold level evolution.
        indent_len = 0
        if (prev_lvl and prev_block is not None and
           not self.editor.is_comment(prev_block)):
            # ignore commented lines (could have arbitary indentation)
            prev_text = prev_block.text()
            indent_len = (len(prev_text) - len(prev_text.lstrip())) // prev_lvl
        if indent_len == 0:
            indent_len = len(self.editor.indent_chars)

        return (len(text) - len(text.lstrip())) // indent_len
90642
def flatten_blocks(lines, num_indents=-1):
    
    # The standard indent is four spaces
    INDENTATION = " " * 4

    if not lines:
        return ""

    # If this is a string, add the indentation and finish here
    if isinstance(lines, six.string_types):
        return INDENTATION * num_indents + lines

    # If this is not a string, join the lines and recurse
    return "\n".join([flatten_blocks(line, num_indents + 1) for line in lines])
767212
def computeIndent(self, block, char):
        
        prevBlockText = block.previous().text()  # invalid block returns empty text
        if char == '\n' and \
           prevBlockText.strip() == '':  # continue indentation, if no text
            return self._prevBlockIndent(block)
        else:  # be smart
            return self.computeSmartIndent(block, char)
1020426
def indent(block, spaces):
    
    new_block = ''
    for line in block.split('\n'):
        new_block += spaces + line + '\n'
    return new_block
1788
def get_base_indentation(code, include_start=False):
    
    new_line_indentation = re_new_line_indentation[include_start].finditer(code)
    new_line_indentation = tuple(m.groups(0)[0] for m in new_line_indentation)
    if new_line_indentation:
        return min(new_line_indentation, key=len)
    else:
        return ""
1138391
def tryMatchedAnchor(self, block, autoIndent):
        
        oposite = { ')': '(',
                    '}': '{',
                    ']': '['}

        char = self._firstNonSpaceChar(block)
        if not char in oposite.keys():
            return None

        # we pressed enter in e.g. ()
        try:
            foundBlock, foundColumn = self.findBracketBackward(block, 0, oposite[char])
        except ValueError:
            return None

        if autoIndent:
            # when aligning only, don't be too smart and just take the indent level of the open anchor
            return self._blockIndent(foundBlock)

        lastChar = self._lastNonSpaceChar(block.previous())
        charsMatch = ( lastChar == '(' and char == ')' ) or \
                     ( lastChar == '{' and char == '}' ) or \
                     ( lastChar == '[' and char == ']' )

        indentation = None
        if (not charsMatch) and char != '}':
            # otherwise check whether the last line has the expected
            # indentation, if not use it instead and place the closing
            # anchor on the level of the opening anchor
            expectedIndentation = self._increaseIndent(self._blockIndent(foundBlock))
            actualIndentation = self._increaseIndent(self._blockIndent(block.previous()))
            indentation = None
            if len(expectedIndentation) <= len(actualIndentation):
                if lastChar == ',':
                    # use indentation of last line instead and place closing anchor
                    # in same column of the opening anchor
                    self._qpart.insertText((block.blockNumber(), self._firstNonSpaceColumn(block.text())), '\n')
                    self._qpart.cursorPosition = (block.blockNumber(), len(actualIndentation))
                    # indent closing anchor
                    self._setBlockIndent(block.next(), self._makeIndentAsColumn(foundBlock, foundColumn))
                    indentation = actualIndentation
                elif expectedIndentation == self._blockIndent(block.previous()):
                    # otherwise don't add a new line, just use indentation of closing anchor line
                    indentation = self._blockIndent(foundBlock)
                else:
                    # otherwise don't add a new line, just align on closing anchor
                    indentation = self._makeIndentAsColumn(foundBlock, foundColumn)

                dbg("tryMatchedAnchor: success in line %d" % foundBlock.blockNumber())
                return indentation

        # otherwise we i.e. pressed enter between (), [] or when we enter before curly brace
        # increase indentation and place closing anchor on the next line
        indentation = self._blockIndent(foundBlock)
        self._qpart.replaceText((block.blockNumber(), 0), len(self._blockIndent(block)), "\n")
        self._qpart.cursorPosition = (block.blockNumber(), len(indentation))
        # indent closing brace
        self._setBlockIndent(block.next(), indentation)
        dbg("tryMatchedAnchor: success in line %d" % foundBlock.blockNumber())
        return self._increaseIndent(indentation)
820649
def get_line_indent(token):
    """"""
    start = token.start_mark.buffer.rfind('\n', 0,
                                          token.start_mark.pointer) + 1
    content = start
    while token.start_mark.buffer[content] == ' ':
        content += 1
    return content - start
409330
def check_root_ruleset_indent(node, actual_indent)
      # Whether node is a ruleset not nested within any other ruleset.
      if @indent == 0 && node.is_a?(Sass::Tree::RuleNode)
        unless actual_indent % @indent_width == 0
          add_lint(node.line, lint_message("a multiple of #{@indent_width}", actual_indent))
          return true
        end
      end

      false
    end
462914
def parse_block_scalar_empty_line(IndentTokenClass, ContentTokenClass):
    """"""
    def callback(lexer, match, context):
        text = match.group()
        if (context.block_scalar_indent is None or
                len(text) <= context.block_scalar_indent):
            if text:
                yield match.start(), IndentTokenClass, text
        else:
            indentation = text[:context.block_scalar_indent]
            content = text[context.block_scalar_indent:]
            yield match.start(), IndentTokenClass, indentation
            yield (match.start()+context.block_scalar_indent,
                    ContentTokenClass, content)
        context.pos = match.end()
    return callback
846625
def find_parent_scope(block):
        """"""
        original = block
        if not TextBlockHelper.is_fold_trigger(block):
            # search level of next non blank line
            while block.text().strip() == '' and block.isValid():
                block = block.next()
            ref_lvl = TextBlockHelper.get_fold_lvl(block) - 1
            block = original
            while (block.blockNumber() and
                   (not TextBlockHelper.is_fold_trigger(block) or
                    TextBlockHelper.get_fold_lvl(block) > ref_lvl)):
                block = block.previous()
        return block
340917
def get_indentation(func):
    
    src_lines = getsourcelines(func)[0]
    for line in src_lines:
        if not (line.startswith('@') or line.startswith('def') or line.lstrip().startswith('#')):
            return line[:len(line) - len(line.lstrip())]
    return pytypes.default_indent
823147
def find_hash_parents(toc, title)
      parents = ''
      toc.each_key do |key|
        next if toc[key].nil?
        toc[key].each do |item|
          if item.is_a?(Hash)
            if item.keys.include?(title)
              parents = key
              break
            else
              if item[item.keys.first].include?(title)
                parents = key
                break
              end
            end
          elsif title == item
            parents = key
            break
          end
        end
        break unless parents.empty?
      end
      parents
    end
1344715
def indent(self):
        
        blk = IndentBlock(self, self._indent)
        self._indent += 1
        return blk
105760
def describe_root(record, root, indent=0, suppress_values=False):
    
    def format_node(n, extra=None, indent=0):
        """
        Depends on closure over `record` and `suppress_values`.

        Args:
          n (Evtx.Nodes.BXmlNode):
          extra (str):

        Returns:
          str:
        """
        ret = ""
        indent_s = '  ' * indent
        name = n.__class__.__name__
        offset = n.offset() - record.offset()
        if extra is not None:
            ret = "%s%s(offset=%s, %s)" % (indent_s, name, hex(offset), extra)
        else:
            ret = "%s%s(offset=%s)" % (indent_s, name, hex(offset))

        if not suppress_values and isinstance(n, VariantTypeNode):
            ret += " --> %s" % (n.string())
            if isinstance(n, BXmlTypeNode):
                ret += "\n"
                ret += describe_root(record, n._root, indent=indent + 1)

        return ret

    def rec(node, indent=0):
        """
        Args:
          node (Evtx.Nodes.BXmlNode):
          indent (int):

        Returns:
          str:
        """
        ret = ""
        if isinstance(node, TemplateInstanceNode):
            if node.is_resident_template():
                extra = "resident=True, length=%s" % (hex(node.template().data_length()))
                ret += "%s\n" % (format_node(node, extra=extra, indent=indent))
                ret += rec(node.template(), indent=indent + 1)
            else:
                ret += "%s\n" % (format_node(node, extra="resident=False", indent=indent))
        else:
            ret += "%s\n" % (format_node(node, indent=indent))

        for child in node.children():
            ret += rec(child, indent=indent + 1)

        if isinstance(node, RootNode):
            ofs = node.tag_and_children_length()
            indent_s = '  ' * (indent + 1)
            offset = node.offset() - record.offset() + ofs
            ret += "%sSubstitutions(offset=%s)\n" % (indent_s, hex(offset))
            for sub in node.substitutions():
                ret += "%s\n" % (format_node(sub, indent=indent + 2))

        return ret

    ret = ""
    ret += rec(root, indent=indent)
    return ret
1181084
def unindent(self):
        

        cursor = self.textCursor()
        if not cursor.hasSelection():
            cursor.movePosition(QTextCursor.StartOfBlock)
            line = foundations.strings.to_string(self.document().findBlockByNumber(cursor.blockNumber()).text())
            indent_marker = re.match(r"({0})".format(self.__indent_marker), line)
            if indent_marker:
                foundations.common.repeat(cursor.deleteChar, len(indent_marker.group(1)))
        else:
            block = self.document().findBlock(cursor.selectionStart())
            while True:
                block_cursor = self.textCursor()
                block_cursor.setPosition(block.position())
                indent_marker = re.match(r"({0})".format(self.__indent_marker), block.text())
                if indent_marker:
                    foundations.common.repeat(block_cursor.deleteChar, len(indent_marker.group(1)))
                if block.contains(cursor.selectionEnd()):
                    break
                block = block.next()
        return True