def has_default_value_changed(node_tree, node, value):
    """
    Utility to check whether a given `value` of a `node` has been changed at all
    from its default, and hence to check whether we need to bother to add code to
    set its value.

    `value` is either an input socket of the node with a default_value, or just a
    python variable name string to check
    """

    def compare(a, b):
        a = np.array(a)
        b = np.array(b)
        return np.all(a == b)

    temp_default_node = node_tree.nodes.new(node.bl_idname)
    if node.bl_idname.endswith("NodeGroup"):
        temp_default_node.node_tree = node.node_tree

    if isinstance(value, bpy.types.NodeSocket):
        assert get_connected_link(node_tree, input_socket=value) is None
        assert hasattr(value, "default_value")

        observed_val = value.default_value
        default_socket = [
            i for i in temp_default_node.inputs if i.identifier == value.identifier
        ][0]
        default_val = default_socket.default_value
        has_changed = not compare(observed_val, default_val)
    elif isinstance(value, str):
        assert hasattr(node, value)
        has_changed = not compare(
            getattr(node, value), getattr(temp_default_node, value)
        )
    else:
        node_tree.nodes.remove(temp_default_node)
        raise ValueError(f"Unexpected input {value=} in has_default_value_changed")

    node_tree.nodes.remove(temp_default_node)

    return has_changed

    Utility to check whether a given `value` of a `node` has been changed at all
    from its default, and hence to check whether we need to bother to add code to
    set its value.

    `value` is either an input socket of the node with a default_value, or just a
    python variable name string to check
    
infinigen/core/nodes/node_transpiler/transpiler.py