def METHOD_NAME(m):
    node = etree.Element("script")
    node.set("type", "math/tex; mode=display")
    if "\\begin" in m.group(2):
        node.text = AtomicString("".join(m.group(2, 4, 5)))
        return _wrap_node(node, "".join(m.group(1, 2, 4, 5, 6)), "div")
    else:
        node.text = AtomicString(m.group(3))
        return _wrap_node(node, "".join(m.group(2, 3, 4)), "div")