def prune(dt, min_samples_leaf=1):
    """
    Prune a tree model by setting node children to -1. Note: displaying the
    graph will still show all nodes.

    Args:
        dt (obj): The decision tree to be pruned.
        min_samples_leaf (int): Minimum number of samples.
    """
    # Pruning is done by the "min_samples_leaf" property of decision trees
    if dt.min_samples_leaf >= min_samples_leaf:
        print('The tree is already pruned at an equal or higher level.')
    else:
        # update prune parameter
        dt.min_samples_leaf = min_samples_leaf

        # loop through each node of the tree
        tree = dt.tree_
        for i in range(tree.node_count):
            n_samples = tree.n_node_samples[i]
            if n_samples <= min_samples_leaf:
                # we can't delete splits because they are fixed in the model
                # instead, we remove the split by setting the child values to -1
                tree.children_left[i] = -1
                tree.children_right[i] = -1

    return dt