code: def smallest_matrix_subexpr(t):
      """
      During visualization, we need to find the smallest expression
      that evaluates to a non-scalar. That corresponds to the deepest subtree
      that evaluates to a non-scalar. Because we do not have parent pointers,
      we cannot start at the leaves and walk upwards. Instead, pass a Boolean
      back to indicate whether this node or one of the descendants
      evaluates to a non-scalar.  Nodes in the tree that have matrix values and
      no matrix below are the ones to visualize.
      """
      nodes = []
      _smallest_matrix_subexpr(t, nodes)
      return nodes
  
imports: import os
  import sys
  import traceback
  import inspect
  import hashlib
  from pathlib import Path
  import matplotlib.pyplot
  import tsensor
label_desc: Use image node_id 6 for calling a global function with example usage: smallest_matrix_subexpr(t) and returns: nodes