code: function upstream_sources(g, node) {
      var flatMap = _.compose(_.flatten, _.map);
      function rec(node) {
          var inputs = g.node_get_inputs(node);
          var sources = _.filter(inputs, (node) => {
              return node.name === 'read' || node.name === 'emit';
          });
          var nonsources = _.difference(inputs, sources);
          return sources.concat(flatMap(nonsources, rec));
      }
      return _.uniq(rec(node));
  }
docs: Returns a list of all the source (`read` and `emit`) nodes that are upstream of the passed-in node.