def parse_text(directive, text, node_type=nodes.paragraph, where=None):
    """Parses text in ReST format and returns a node with the content."""
    assert text is not None, 'Missing text during parse_text in %s' % where

    vl = ViewList()

    for line in text.split('\n'):
        vl.append(line, line)

    node = node_type(rawsource=text)
    directive.state.nested_parse(vl, 0, node)

    return node
dataset/ETHPy150Open reviewboard/rbtools/docs/rbtools/_ext/rbt_commands.py/parse_text/original