def METHOD_NAME(md, s):
    """Extract TOC headings into list structure of::
        [
          ('toc_1', 'Introduction', 1),
          ('toc_2', 'Install', 2),
          ('toc_3', 'Upgrade', 2),
          ('toc_4', 'License', 1),
        ]
    :param md: Markdown Instance with TOC plugin.
    :param s: text string.
    """
    s, state = md.before_parse(s, {})
    md.block.parse(s, state)
    headings = state.get('toc_headings')
    if not headings:
        return []
    return list(_cleanup_headings_text(md.inline, headings, state))