def insert_and_remove_cost(node: Node):
    """
    Insert and remove cost for tree edit distance.
    If leaf node, cost is length of label name.
    Otherwise, 1
    """
    label = node.label
    if "<leaf>" in label:
        return len(label.replace("<leaf>", ""))
    else:
        return 1

    Insert and remove cost for tree edit distance.
    If leaf node, cost is length of label name.
    Otherwise, 1
    
vlmeval/dataset/utils/ccocr_evaluator/kie_evaluator.py