

def get_level(self, parent, block):
    ' Get level of indent based on list level. '
    m = self.INDENT_RE.match(block)
    if m:
        indent_level = (len(m.group(1)) / self.tab_length)
    else:
        indent_level = 0
    if self.parser.state.isstate('list'):
        level = 1
    else:
        level = 0
    while (indent_level > level):
        child = self.lastChild(parent)
        if (child and ((child.tag in self.LIST_TYPES) or (child.tag in self.ITEM_TYPES))):
            if (child.tag in self.LIST_TYPES):
                level += 1
            parent = child
        else:
            break
    return (level, parent)

dataset/ETHPy150Open darcyliu/storyboard/markdown/blockprocessors.py ListIndentProcessor.get_level/original