code: def predecessors(graphdef, name):
      node_map = {}
      for n in graphdef.node:
          node_map[n.name] = n
  
      seen = []
  
      def get_predecessors(node_name):
          if node_name not in node_map:
              return []
          node = node_map[node_name]
          preds = []
          for inp in node.input:
              if inp in seen:
                  continue
              seen.append(inp)
              preds.append(inp)
              inp_preds = get_predecessors(inp)
              preds += inp_preds
          return list(set(preds))
  
      return get_predecessors(name)
  
imports: import lucid.optvis.render
label_desc: Use image node_id 1 for calling a global function with example usage: predecessors(graphdef, name) and returns: get_predecessors, list, list