def METHOD_NAME(canvas_node: "CanvasNode", net_id: int) -> Optional[Interface]:
    iface = None
    for edge in canvas_node.edges:
        link = edge.link
        if link.node1_id == net_id:
            iface = link.iface2
        elif link.node2_id == net_id:
            iface = link.iface1
    return iface