def METHOD_NAME(text, tag, slot):
    i = 0
    while text[i] in "><=~":
        i += 1
    op = text[:i]
    text = text[i:]
    range = ops[op]
    slot = f' slot="{slot}"' if slot else ""
    return f'<{tag} range="{range}"{slot}>{text}</{tag}>'