def use(svg, node, font_size):
    """Draw use tags."""
    x, y = svg.point(node.get('x'), node.get('y'), font_size)

    for attribute in ('x', 'y', 'viewBox', 'mask'):
        if attribute in node.attrib:
            del node.attrib[attribute]

    if (tree := get_use_tree(svg, node, font_size)) is None:
        return

    if tree.tag in ('svg', 'symbol'):
        # Explicitely specified
        # https://www.w3.org/TR/SVG11/struct.html#UseElement
        if 'width' in node.attrib and 'height' in node.attrib:
            tree.attrib['width'] = node.attrib['width']
            tree.attrib['height'] = node.attrib['height']
        else:
            tree._etree_node.tag = 'g'
            box = bounding_box(svg, tree, font_size, stroke=True)
            if is_valid_bounding_box(box):
                tree.attrib['width'] = box[0] + box[2]
                tree.attrib['height'] = box[1] + box[3]
        tree._etree_node.tag = 'svg'

    node.cascade(tree)
    node.override_iter(iter((tree,)))
    svg.stream.transform(e=x, f=y)
Draw use tags.
weasyprint/svg/defs.py