code: def random_prunable_decision_node(tree: Tree) -> DecisionNode:
      """
      Returns a random decision node that can be pruned
      i.e. a random draw from the set of decision nodes that have two leaf node children
      """
      leaf_parents = tree.prunable_decision_nodes
      if len(leaf_parents) == 0:
          raise NoPrunableNodeException()
      return np.random.choice(leaf_parents)
  
file_path: imodels/imodels/experimental/bartpy/samplers/unconstrainedtree/proposer.py
imports: from operator import le, gt
  from typing import Callable, List, Mapping, Optional, Tuple
  import numpy
  from ...errors import NoSplittableVariableException, NoPrunableNodeException
  from ...mutation import TreeMutation, GrowMutation, PruneMutation
  from ...node import LeafNode, DecisionNode, split_node
  from ...samplers.scalar import DiscreteSampler
  from ...samplers.treemutation import TreeMutationProposer
  from ...split import SplitCondition
  from ...tree import Tree
label_desc: Use image node_id 4 for calling a global function with example usage: random_prunable_decision_node(tree) and returns: np