def _parse(self, text):

        candidates = PATTERN_RE.findall(text)
        headers = []
        levels = []
        idx = 0

        for over, title, under in candidates:
            # validate.
            if ((over == '' or over == under) and len(under) >= len(title)
                    and len(set(under)) == 1):
                # encode the adornment of the header to calculate its level
                adornment = under[0] * (2 if over else 1)
                if adornment not in levels:
                    levels.append(adornment)
                level = levels.index(adornment)
                raw = (over + '\n' if over else '') + title + '\n' + under
                start = text.find(raw) - 1  # see comment on __init__
                end = start + len(raw)
                h = Header(level, start, end, adornment, title, raw, idx)
                idx += 1
                headers.append(h)
        return headers
Returns the instance of a different plugin, given by its id.
dataset/ETHPy150Open mgaitan/sublime-rst-completion/headers.py/RstHeaderTree._parse--crossover with--dataset/ETHPy150Open tobspr/RenderPipeline/rpcore/pluginbase/base_plugin.py/BasePlugin.get_plugin_instance